I have faced the same problem in developing Android media player.
I detach the audio from the .mp4 file using iMove. It's very very easy to do that, double click the video and select the detach the audio, then delete the audio track.
I transmit the video track and audio track separately, as for video I'm using rtsp, as for audio, I'm using apache web server, android can read the audio statically, just like reading local files.
BTW, I have tried using every protocol provided by Wowza to stream .mp3, none of them works.
My code is the following:
public void PlayVideo() {
MediaController vidControl = new MediaController(this);
vidControl.setAnchorView(VideoPlayer);
VideoPlayer.setMediaController(vidControl);
VideoPlayer.setVideoPath("rtsp://137.110.90.123:1935/vod/SamNoSound.mp4");
VideoPlayer.start();
}
public void PlayAudio() {
//play audio
String url = "http://137.110.90.123/~chenyu/sample.mp3"; // your URL here
try {
AudioPlayer.setDataSource(url);
AudioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
AudioPlayer.prepare();
AudioPlayer.start();
} catch (IOException e) {
e.printStackTrace();
}
I would say if you really want to emphasize on streaming, I would recommend to use VLC, my command for streaming .mp3 is:
Only Stream Audio
vlc /Users/chenyu/Sites/XXXX.mp3 -I http --sout "#transcode{ab=128,samplerate=44100,channels=2,acodec=mpga,vcodec=none}:gather:rtp{mp4a-latm,sdp=rtsp://137.110.92.231:5554/stream.sdp}"