How to play audio from a stream in android???
I will get input stream from an online link( like continuous FM).
I need to cache the stream and play it.
I searched a lot in sites,,,but didnt get.They show option of playing from a stored file.
There is no option to play from a stream.
See if this tutorial helps:
Custom Audio Streaming with Media player
Related
I want to play audio file backward using exoplayer (or other media player) in Android Device.
It says to be very difficult to play video backward:
https://github.com/google/ExoPlayer/issues/2191
But, if I can reverse the pcm sample data stream going in player, I can play audio backward.
I'm now trying reverse part of music file using 'android.media.MediaExtractor' & 'android.media.MediaCodec'. But I can't create an reversed audio stream because I don't know how to create the header of sample data in short array.
The best option is to play audio file backward in ExoPlayer, the second option is create reversed audio stream and play it, the last option will be any method to play audio backward.
Thanks for your attention. I’m looking forward to your reply.
Has anyone had any success playing back an audio RTMP stream on Android using http://code.google.com/p/android-rtmp-client or know of any other non-flash solutions. The example that comes with the android rtmp source records the audio to a file but I'm looking for example code that plays back over speakers (or bluetooth).
The easiest way to play an audio RTMP stream in Android has a partial discussion of what's needed.
We are trying to develop an app for Android where you can play a live streaming URL. I tried several approaches using the MediaPlayer and StreamPlayer... but no luck with the URL playing.
I can of cause play a static MP4 or MP3 file using the URL (hosted on a server) but when I try to play a stream URL it doesn't play or give an error.
Any thoughts?
Mp3 stream works well on Mediaplayer from Android 2.2 and above. If you want to play the Content below 2.2 then its better to use local proxy server implementation. check Npr . Which uses the same approach.
If you want to play wma audio you should convert that into PCM and play it. check aacplayer. In aacplayer project he gets wma content from mms:// stream and plays it . You can edit that to play only wma content. But i haven't tried playing any wmv videos.
I have made a Android streaming application that plays media from online URL's. For playing the media, I am using the
standard MediaPlayer class for playing media.
As per the Android documentation, it supports RTSP protocol for audio & video playback
http://developer.android.com/guide/appendix/media-formats.html
But when I am trying to play media from a RTSP URL, it gets connected but I am not able to hear any media
Following is one of those RTSP URL -
rtsp://sfera.live24.gr/sfera4132
Does anybody media have an idea of playing RTSP URL's through the Android MediaPlayer
Thanks
That link you provided has 3 audio tracks, with the first and last tracks appearing to be silent and don't contain any valid audio.
The middle track has audio (as per VLC). I don't know how Android deals with multiple audio tracks. I imagine you may get better results if you use links that only contain 1 audio and 1 video track at most.
I expect for an rtsp stream with multiple audio tracks, android is only going to play the first one as there is no user interface to select a specific audio stream, hence why you aren't hearing any audio.
If this is a stream from your own server, to hear the audio you should adjust the SDP file the valid audio track first. If this is not from your server, I don't know what you're options are.
I am completely new to displaying streaming either audio or video content using media player.
Somehow using post available here, i am able to display RTSP content(.3gp video) in my MediaPlayer implementation.
How to identify streaming content is audio only stream or audio/video stream using MediaPlayer class or streaming link?
I could be wrong here, but I believe there is only a MediaPLayer.OnInfoListner API available in Java to get information about the content stream being played. Not sure of how helpful that API actually is though. You might also want to try stream scrapers(is what I believe they are called) to get stream data and see if there is both audio and video channel to make a determination.