Can't hear the audio rtp streaming
Hi, I am trying to get the streaming audio from my robot's mic to my tablet so i used the ffmpeg to create the stream :
ffmpeg -f alsa -i hw:0 -acodec libmp3lame -f rtp rtp://224.1.2.4:7001/test.ffm
The streaming is working perfectly between the robot and and my computer in the same lan , so i tried this code to get the audio streaming working on tablet but i hear nothing coming out from the tablet . note that 192.168.1.120
is my tablet's ip .
try {
audioGroup = new AudioGroup();
audioGroup.setMode(AudioGroup.MODE_NORMAL);
audioStream = new AudioStream(InetAddress.getByAddress(new byte[] {(byte)192, (byte)168, (byte)1, (byte)120 }));
audioStream.setCodec(AudioCodec.PCMU);
audioStream.setMode(RtpStream.MODE_NORMAL);
audioStream.associate(InetAddress.getByAddress(new byte[] {(byte)224, (byte)1, (byte)2, (byte)4 }), 7001);
audioStream.join(audioGroup);
AudioManager Audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
Audio.setMode(AudioManager.MODE_IN_COMMUNICATION);
}
catch (SocketException e) { e.printStackTrace();}
catch (UnknownHostException e) { e.printStackTrace();}
catch (Exception ex) { ex.printStackTrace();}}
From my android's studio monitor i can see that the app is not receiving any rtp
packages but it is sending packages to 224.1.2.4
. Please i need to know what's the problem and how to fix it .
Asked by starter on 2016-07-18 17:06:29 UTC
Comments
This forum is for questions about ROS (Robot Operating System); we don't know much about audio streaming. I'd suggest you post on a broader forum like Stack Exchange, or search for a forum that specializes in audio streaming on Android.
Asked by ahendrix on 2016-07-18 17:51:20 UTC