Playing an audio file in reverse using ExoPlayer - android

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.

Related

Streaming audio file and caching it

I want to stream an audio mp3 file and then play it through android media player plus I also want to cache this file, so that mediaplayer don't have to stream for recently played tracks.
I have tried using prepareAsync method but it doesn't give me access to buffer content, so I have decided to stream the audio file myself and then pass it to the media player for playing. I have achieved this by following this article here but this approach has a problem i.e. while transferring the file to media player it goes into error mode which causes my player to behave inconsistently.
When media player enters its error mode it doesn't come out of it automatically so I am forced to create a new media player and then re-provide it the downloaded file, this workaround causes the user to experience an undesired pause in the song playing.
So, does any one have improved an version of code given in above link? or do they know a better solution to this problem or is there is actually a library for streaming an audio file in android?
Thanks
The link you provided looks like a less than ideal solution (not to mention outdated). What you probably want is a local proxy server that gives you access to byte data before the MediaPlayer gets it. See my answer here for a little more explanation.

What playlist format does Android 2.2 support to stream?

Hello i am trying to get my android 2.2 app stream music. So far I have been able to stream from a radio station via the mediaPlayer.setDataSource("STREAM HERE")
I have tried with a m3u file and it won't work (unless my m3u file is wrong). Can it support xspf or what other file types?
How could i go about solving this problem?
thanks a lot
The setDataSource() method on the media player will accept file or URIs for a media source. Look at this list to see what media formats the media player accepts: http://developer.android.com/guide/appendix/media-formats.html
I am fairly certain that the media player will not play playlist files like M3U. You would have to create your own M3U player, which could be accomplished via the MediaPlayer method: setOnCompletionListener(MediaPlayer.OnCompletionListener listener)
Register a callback to be invoked when the end of a media source has been reached during playback.
When playback is done, you could start playing the next media resource in your playlist.

Problem playing media from RTSP URL in Android

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.

Android Mediaplayer :: How to detect streaming content type (audio or video)

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.

play audio from a stream in android

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

Categories

Resources