Android :: How To Implement An Audio Player - Using MediaPlayer And MediaController

Feb 8, 2010

I want to create an Android application that is a client for an Internet radio station. And I want it look native to Android? But im confused with Android API logic and documentation. What i've got is that I need MediaPlayer and MediaController classes. Am I right, and is there any good example of AUDIO player for Android?

Especially, I'm very interested how to use MediaPlayer and MediaController classes together.

UPD:

Finally I've got the code, that does exactly what I want:

CODE:..............

ADVERTISEMENT

Android :: Seek Bar Of Mediacontroller Not Updating According To De Audio Player

Oct 11, 2010

The seek bar of Mediacontroller is not been updating according to de audio player. Only when the trackball is shifted, or the play/pause button is clicked, the seek bar tracks the audio player. Could anybody give me any clue?

View 3 Replies View Related

Android :: MediaController In MediaPlayer

Jun 4, 2010

I am using MediaPlayer to build a Video player for playing local video files. However, I don't know how to enable MediaController for my player. I want the media control buttons that pop up when you touch the video surface.

View 6 Replies View Related

Android :: MediaController With MediaPlayer

Jun 2, 2010

I want media controls such as play/pause for streaming audio that I am playing in my app. I am using MediaPlayer to stream and play the audio. how to use MediaController with MediaPlayer?

View 3 Replies View Related

Android :: Customize MediaController / Change Style Of Droid MediaController?

Jan 11, 2010

Is there a way to customize the MediaController? I need to change the style of buttons, SeekBar etc.

View 1 Replies View Related

Android :: Streaming Audio From URL Using MediaPlayer?

Dec 27, 2009

I've been trying to stream mp3's over http using Android's built in MediaPlayer class. The documentation would suggest to me that this should be as easy as :

MediaPlayer mp = new MediaPlayer();
mp.setDataSource(URL_OF_FILE);
mp.prepare();
mp.start();

However I am getting the following repeatedly. I have tried different URLs as well. Please don't tell me that streaming doesn't work on mp3's.

E/PlayerDriver( 31): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported
W/PlayerDriver( 31): PVMFInfoErrorHandlingComplete
E/MediaPlayer( 198): error (1, -4)
E/MediaPlayer( 198): start called in state 0
E/MediaPlayer( 198): error (-38, 0)
E/MediaPlayer( 198): Error (1,-4)
E/MediaPlayer( 198): Error (-38,0)

View 8 Replies View Related

Android :: Audio (MediaPlayer) On (Archos 5 IT)

Apr 27, 2010

Does anyone know the filepath for an Archos? I'm trying to get some media/audio to play, and it just won't find it...

public void onClick(View v1) {
final MediaPlayer mp = new MediaPlayer();
try {
mp.setDataSource("ARCHOS5:/Music/manowar.mp3");
mp.start();
Toast.makeText(Textbox.this, "Working", Toast.LENGTH_LONG).show();
mp.setLooping(true);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();............................

View 1 Replies View Related

Motorola :: Android Player To Recognize Audio Tags On Lossless Audio Files?

May 23, 2010

Does anyone know if there is a way for either meridian or the regular android player to recognize audio tags on lossless audio files?

View 1 Replies View Related

Android :: Playing Audio Stream Not Working Using MediaPlayer

Nov 27, 2009

I am trying to make a very simple radio player for Android and I cannot get the audio streaming to work. In my latest attempt it plays for about 1 second and stops for some streams and it doesnt work at all for some other streams. Logcat doesn't give much useful information to me. I am testing on HTC Hero (Android 1.5).

If I hook the completion and buffer events I see the audio gets a complete event but it keeps buffering. Is there anything wrong with the code below? Should I be able to stream the the audio streams below? Is there a complete example somewhere of a working radio streaming?................

View 5 Replies View Related

Android :: Mediaplayer To Play Live Streaming Audio

Nov 8, 2010

In my music app, i would like to play live streaming like radio broadcasting with mediaplayer as Mediaplayer mp = new Mediaplayer(); mp.setDataSource(LiveStreamingURL); mp.prepare(); mp.start(); but after playing for few seconds it is stopped. I dont know how to overcome it. Give me your suggestions for this.

View 3 Replies View Related

Android :: Correctly Set MediaPlayer Audio Stream Type

Aug 21, 2010

I'm trying to create a way to adjust volume settings for each of the different streams (media, notification, ringtone, etc) and have a way to preview the output sound level of each stream. I believe I have the correct implementation, but when I set the output stream type, there is no sound that plays.

Here is the code that correctly plays the user's selected alarm sound:

CODE:.................

That commented out line is what is causing me problems. I would like to hear the alarm sound at the volume levels of the different audio streams, but when I include that line for STREAM_ALARM or any other audio stream, no sound at all plays.

View 1 Replies View Related

Android :: Audio Files Return 0 From MediaPlayer.getDuration()

Apr 8, 2009

Some audio files return 0 from MediaPlayer.getDuration(), even though they're perfectly valid files that play ok and that players on Windows can find the duration of. There seem to be two different cases here: certain file types such as .wma and .wav always return 0 duration, and others only do so sometimes. I haven't been able to find any pattern in the latter case, but it does seem consistent per file. The music player displays 0:00 duration for these, so it's not just my code.

View 3 Replies View Related

Android :: MediaPlayer Provides Wrong Duration On Audio Streaming

May 27, 2010

I am having the following problem: I am using Android's MediaPlayer to play an mp3 through an HTTP connection. The audio is played correctly, but the MediaPlayer returns an incorrect duration (calling mediaPlayer.getDuration() ). Depending on the mp3 the duration is either shorter or longer. The code that plays the audio is the following:

mediaPlayer = new MediaPlayer(); mediaPlayer.setOnCompletionListener(this); mediaPlayer.setOnErrorListener(this); mediaPlayer.setOnPreparedListener(this); mediaPlayer.setOnBufferingUpdateListener(this); mediaPlayer.setDataSource("a valid URL"); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.prepareAsync();............................

View 2 Replies View Related

Android :: Possible Mit Sdk1.6 Audio Decoder To Access Without Using MediaPlayer?

Oct 13, 2009

Is it now possible mit sdk1.6 the audio decoder to access/use without using MediaPlayer ?

I saw : New version of OpenCore

Android 1.6 includes the updated OpenCore 2 media engine, which has:

* Support for OpenMAX encoders* Support for additional audio codecs in AuthorEngine* Improved buffering model supports shared buffers allocated in the decoder. but dont know how!

View 3 Replies View Related

Android :: Native MediaPlayer Plays Audio But Not Video - 3gp Format

Jun 16, 2009

I have the following native source code that is supposed to display video. It plays 3gp file ok and I can hear the audio, but the video is not shown.

CODE:..............

View 4 Replies View Related

Android :: Mediaplayer - Stop Button And That Stops Audio From Playing

Nov 18, 2009

I have a activity which is called from another activity as an intent... This activity loads and starts playing a audio file. All is good - that much works. The activity also has a "stop" button and that stops the audio from playing - that is also fine.

But how do I stop the file from playing if the user uses the back button to leave the activity without clicking on the "Stop" button?

View 3 Replies View Related

Android :: Poor Audio Quality Captured From Microphone With MediaRecorder / Implement Them?

Aug 11, 2009

I've implemented "Audio Capture Setup and Start" example (http:// developer.android.com/guide/topics/media/index.html) with small modification - the output format is MPEG_4 not THREE_GPP.

The result - records with extremely poor audio quality.

Could you help me to understand where is error and how is possible to do really good audio records with Android?

I've done an experiment with Camcorder - standard Android application. Sound quality of the video is same poor. The audio signal is extremely low (quite).

Is it "by design" or may be some hardware problem (T-Mobile G1)?

I've found description similar problem here - http://osdir.com/ml/AndroidDevelopers/2009-06/msg00752.html - "Microphone audio capture with emulator is of very poor quality". In my case this problem reproduces on the real device. Unfortunately I have not found answer. I read about some "custom" encoders.. but have not found any example how implement them.

View 2 Replies View Related

Android :: Play Remote Audio File In Android Audio Player

Nov 12, 2010

I am working on a application that would allow users to play remote files. My question is how do I open those remote files to be played in the default android player?but this does not give me control of what is happening!

View 2 Replies View Related

HTC Incredible :: WAV File Player - Player Does Not Support This Type Of Audio File

May 19, 2010

Every time someone leaves me a voicemail on my home phone number, VOIP home phone voice mail box sends me the voicemail as a .wav file attachment. When I try to play this .wav file the phone refuses, saying "Sorry, the player does not support this type of audio file".

So, I take it the .wav files cannot be played on Android phones. Has anyone found a workable and simple workaround to this yet?

View 7 Replies View Related

Android :: MediaPlayer.start - Doesnot Work Fine After Calling MediaPlayer.seekTo - 0

Apr 27, 2009

I have a requirement to play several sounds many times in my game so instead of creating the MediaPlayer again and again I have called mp.seekTo(0) in onCompletion(mp) so that it will restart. Sometimes the sound is not audible from the device when I call mp.start () after setting mp.seekTo(0); but the player calls onCompletion() without playing any sound, this is observed randomly on most of the sounds

My sounds are of short duration mostly less than a second.

I am using a separate MediaPlayer for each sound (as I need this) -

There are almost 28 sounds in my game so i will be creating 28 MediaPlayers.

Below is the attached code for player

Also If I try to play many sounds one after the other in a short period of time i get an error saying "no more track names available". can u tell Why this is happening...?

check the below code:

CODE:........

View 9 Replies View Related

HTC Incredible :: Looking For Audio Player

May 31, 2010

I am looking for an audio player for android HTC Incrdible

View 8 Replies View Related

HTC Magic :: Audio Quality / MP3 Player

May 14, 2009

I am on the verge of signing a contract with vodafone for the magic but listening to music on my phone is quite a big factor (the other handset I was considering was the Nokia 5800 Xpress!) so I was just wondering if anyone had used the magic mp3 player yet and what they thought of the audio quality? It would be useful to know how it compares to the iphone because the mp3 player is not a feature that anyone has focused on in reviews (except for the fact that there is no 3.5mm jack).

View 12 Replies View Related

HTC Incredible :: Best Audio / Media Player

May 7, 2010

I am looking for a media player - to play all kind of music formats, mp3, wav, etc. Also it would be good to have a player that have a simple search through folders capability to go to navigate to phone's internal memory. The player that comes with Incredible has the capability to search through folders in the internal memory, but I don't think it plays all formats. On the other hand I see that "market" place is full of different players, but all that I downloaded only search on SD card and does not have capability to navigate to internal storage. I know one of the simplest solutions would be to put all music on SD card, but heck we have 8Gb of internal storage why not to use it?

View 4 Replies View Related

General :: MX Player Audio Codec?

Nov 28, 2012

MX player popup saying "Unsupported audio codecTS" when started to play movie.

View 1 Replies View Related

HTC EVO 4G :: STREAMING Music Player - Audio Formats

Jul 20, 2010

Any music player that can stream audio formats aac+,pls,m3u.asx,.ram?

View 6 Replies View Related

Android :: Playlist Based Audio Player

Jul 18, 2010

I am looking for an Android Audio Player that is based on a "now playing" playlist, like Amarok, Winamp or WMP. In relation with that playlist, I want buttons to add a song as the next song, or to add the song to the end of the playlist. Like the Rockbox firmware does it. Is there any app out there that works like this? I don't need any advanced features like lyrics, covers, etc, I just want to listen to music. In case there's nothing around, I'll even consider developing my own. Who needs synched lyrics if there's not even an "add next" option?

View 4 Replies View Related

Motorola CLIQ :: Looking For .m3u Streaming Audio Player

Jan 5, 2010

I'm looking for an audio player that will automatically launch when I click on a .m3u file/link from within my browser. So far I've had no luck finding one.

View 1 Replies View Related

Android :: Good Player For Audio Books?

Jun 5, 2010

I'm using Meridian to listen to audio books, but I would sure love to find a player that let's me choose when to start listening. Meridian remembers where I left off in a book, but one slight bump and it goes back to zero. Sure would be nice to have it start at "minute 210" or wherever.

View 6 Replies View Related

Media :: Player That Can Handle Videos With 5.1 Audio

Sep 3, 2010

I really want to know why I can not hear any sound whatsoever simply because the video uses 5.1ch aac instead of 2ch aac. The video part of mp4 plays perfectly, encoded to h.264. I would really like to know if there is any media player able to play these videos correctly without having to resort to any kind of re-encoding (a waste of time when the original encodes should play fine) or having to use special 5.1ch headphones (bulky and not practical to keep on hand all the time). Also, does anyone know if this might be corrected with Froyo 2.2? And last, all my videos that have 2ch audio play as they should, sound and all. Same codec settings were used.

View 7 Replies View Related

HTC Desire :: Don't Put Audio Files In Media Player

Jul 23, 2010

I'm still trying to get to grips with the folder/filing system of the Desire's SD card. I have yet to put any of my own MP3's onto the phone but have put on a few short audio clips which I created at work. These were on the phone mainly so I could transport them home but I also occasionally play them from the phone. However I don't want them cropping up amongst music in the music player app/widget, but it seems no matter where I put them on the SD card they appear. The only exception is if I put them in media => ringtones which isn't ideal. Are there any other places where i can put them where they won't be found by the media player?

View 8 Replies View Related

HTC Incredible :: Flash Player 10.1 - Audio Issue

Aug 31, 2010

Hit up some flash sites...having sound issues namely when I play a video the sound takes a while to catch up and when it does it sounds slow. video plays smooth, is there a way to fix the audio issue?

View 16 Replies View Related

Android :: Audio Player Not Working On High Resolution

Nov 1, 2010

this is my layout for audio player the problem is when resolution is high there is balck space vacant under the play and delete button which located at the bottom of the ui. what i do?

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="840dp"
android:background="#333134"
>
<LinearLayout
android:layout_marginTop="20dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content".................

View 1 Replies View Related

Motorola Droid :: Music Player Crackling Audio

Mar 3, 2010

When will this be fixed! I have a kernal with the supposed 2.0.1 fix however when I put volume to 100%(for jamming in my car) I still get the crackling audio bug! Is there something I can do or will I just have to wait for motorola to fix it?

View 2 Replies View Related

Samsung Captivate :: Stock Music Player 5.1 Audio

Sep 27, 2010

So the stock music player has the 5.1 setting, which to me makes a huge difference over other players. How many of you feel trapped into using it because it sounds better, like me? i wish I could get the same option on other players

View 16 Replies View Related

Android :: Why All Audio Formats Always Passed To Music Player?

Jul 27, 2010

I am writing a music player for esoteric music formats, and have defined mime types for them in my Manifest.
However, the standard music player is always started even though it can't handle the format. Looking at logcat I see;

: D/MediaScannerService( 688): IMediaScannerService.scanFile: / sdcard/download/Cybernoid.sid mimeType: audio/prs.sid : I/ActivityManager( 578): Stopping service: com.android.providers.media/.MediaScannerService : I/ActivityManager( 578): Starting activity: Intent { action=android.intent.action.VIEW data=file:///sdcard/download/ Cybernoid.sid type=audio/prs.sid flags=0x4000000 comp={com.android.music/com.android.music.MediaPlaybackActivity} }

.. so it seems the component is explicitly set to the music player ? Is there any way around this ?

View 3 Replies View Related

Android :: Media Player Minimizes & Still Playing Audio

Jul 5, 2010

I would like to find an media player that plays videos but when I minimize or multitask to another app I want the videos audio to keep playing like pandora does. The reason for this is bcuz I rip videos off of youtube to mainly listen to the music.

View 2 Replies View Related

Android :: Can Media Player Play .wav Fomat Audio?

Feb 16, 2009

I tried to play a piec of 16-bit .wav audio file, no sound came out from my earphone, but .mp3 file would be OK. Do any one else have this kind of experience? This is the code: player = MediaPlayer.create(this, R.raw.test); // I put test.wav in /res/raw player.start();

View 4 Replies View Related

HTC Hero :: Sorry The Player Does Not Support This Type Of Audio File

Sep 25, 2009

Has anyone else had this issue while trying to play MP3's through the Music player? I downloaded this album the other day (legally of course), the first track plays fine but the rest of them just throw up this error.

"Sorry, the player does not support this type of audio file"

The tracks play fine in media player so I'm a little stumped.

View 5 Replies View Related

HTC EVO 4G :: Astro Player Beta For Low Audio Output On Headphones

Jun 28, 2010

Ok we all know that our evo music playback on headphones is ridiculously low especially if you coming from the iPhone, but today I found Astro player beta which have some good equalizer that can boots your audio output to new level,even louder than the iPhone 4 output with the same headphones,so try it out and keep in mind its still in beta stage so it force close a lot but it doesn't affect music playback when it does that.

View 3 Replies View Related

Android :: Possible To Use Media Player To Play Streaming Audio?

Mar 21, 2010

The dev guide suggests this
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(this, Uri.parse("http://wamu-1.streamguys.com:80"));
mp.prepare(); mp.start();
I can't seem to get it working though.
I'm getting "java.io.IOException: Prepare failed.: status=0x1"

View 6 Replies View Related

Media :: Player To Handle MP4 AVC Files With A 5.1 AAC Audio Stream?

Aug 1, 2010

Does anyone know of a player that will handle MP4 AVC files with a 5.1 AAC audio stream? The video plays just fine but none of the players seem capable of "downmixing" to stereo.

I did find one that would play the sound all garbled. I'd hate to have to recode my entire library to stereo to use it on my phone.

View 1 Replies View Related

General :: Audio Player With Remote Control Support?

Oct 3, 2012

I do have an unused Xperia X8 which would perfectly fit as an extension for my HiFi. The X8 should be plugged to the HiFi using a normal stereo jack and should provide the music to the HiFi.

The music should be stored on a network share or/and on the MicroSD card - and in some rare cases on some cloud service.

To find a player which is supporting these things is not a problem - but I do not want to get up every now and then to change music or to skip to the next track or change my playlist.We do have other Android devices lying around as well incl. a tablet So is there a way to control another Android Device which acts as a music player - from another Android device or PC to change music, to skip songs and so on ?!

If you are on PC - that is easy - you get a Web Interface for nearly every piece of software but hey - what about the android eco system - how they play together ?!

View 1 Replies View Related

Media :: Audio Book Or Music Player With Variable Speed

Apr 27, 2010

I love my new HTC Desire and the only thing lacking is a music player that plays at variable speed. I listen to a lot of audio books and my old Sansa Clip player gives the option of playing audio at a faster speed (so you can go finish a book faster).The normal android player doesn't seem to have this option. Is there another player that does?

View 4 Replies View Related

Motorola Milestone :: Player Does Not Support This Type Of Audio File

Jul 22, 2010

I am getting the following error when I try to play some song using the standard "Music" App: "sorry, the player does not support this type of audio file" So far I have only had this happen on .ogg files. I can play some .ogg files with no problem but other will not play. Often there is one I can play and one I can't from the same album which I ripped from my CD in the same ripping session so the encoding parameters should be the same. Another weird thing is that I sometime can succeed in playing a song by finding it in OI File Manager and selecting it there. OI File Manager opens in in the "Music" App and it plays not problem, but I cannot open it from within "Music" App!

View 5 Replies View Related

HTC Droid Eris :: Audio Player Application With Eq - Battery Pull

Aug 7, 2010

Well Like 3mins ago i was running the audio player app with eq and all of a sudden my phone and i had to do a battery pull!

View 3 Replies View Related

ADVERTISEMENT