Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Android


Advertisements:








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


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:..............


View Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Android :: Seek Bar Of Mediacontroller Not Updating According To De Audio Player
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 Replies!   View Related
Android :: MediaController In MediaPlayer
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 Replies!   View Related
Android :: MediaController With MediaPlayer
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 Replies!   View Related
Android :: Customize MediaController / Change Style Of Droid MediaController?
Is there a way to customize the MediaController? I need to change the style of buttons, SeekBar etc.

View Replies!   View Related
Android :: Streaming Audio From URL Using MediaPlayer?
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 Replies!   View Related
Android :: Audio (MediaPlayer) On (Archos 5 IT)
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 Replies!   View Related
Motorola :: Android Player To Recognize Audio Tags On Lossless Audio Files?
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 Replies!   View Related
Android :: Playing Audio Stream Not Working Using MediaPlayer
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 Replies!   View Related
Android :: Mediaplayer To Play Live Streaming Audio
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 Replies!   View Related
Android :: Correctly Set MediaPlayer Audio Stream Type
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 Replies!   View Related
Android :: Audio Files Return 0 From MediaPlayer.getDuration()
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 Replies!   View Related
Android :: MediaPlayer Provides Wrong Duration On Audio Streaming
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 Replies!   View Related
Android :: Possible Mit Sdk1.6 Audio Decoder To Access Without Using MediaPlayer?
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 Replies!   View Related
Android :: Native MediaPlayer Plays Audio But Not Video - 3gp Format
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 Replies!   View Related
Android :: Mediaplayer - Stop Button And That Stops Audio From Playing
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 Replies!   View Related
Android :: Play Remote Audio File In Android Audio Player
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 Replies!   View Related
Android :: Poor Audio Quality Captured From Microphone With MediaRecorder / Implement Them?
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 Replies!   View Related
HTC Incredible :: WAV File Player - Player Does Not Support This Type Of Audio File
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 Replies!   View Related
Android :: MediaPlayer.start - Doesnot Work Fine After Calling MediaPlayer.seekTo - 0
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 Replies!   View Related
Android :: Playlist Based Audio Player
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 Replies!   View Related
Android :: Good Player For Audio Books?
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 Replies!   View Related
HTC Incredible :: Looking For Audio Player
I am looking for an audio player for android HTC Incrdible

View Replies!   View Related
Android :: Audio Player Not Working On High Resolution
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 Replies!   View Related
Android :: Why All Audio Formats Always Passed To Music Player?
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 Replies!   View Related
Android :: Media Player Minimizes & Still Playing Audio
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 Replies!   View Related
Android :: Can Media Player Play .wav Fomat Audio?
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 Replies!   View Related
Android :: Possible To Use Media Player To Play Streaming Audio?
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 Replies!   View Related
HTC Magic :: Audio Quality / MP3 Player
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 Replies!   View Related
HTC Incredible :: Best Audio / Media Player
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 Replies!   View Related
Android :: Getting Streaming Audio To Play With Media Player Class?
I am currently new to android development I been working on the examples in the Dev Guide in the android website. I want to get a stream from a server I have to play in the emulator when I insert the url it doesn't seam to want to play. My question is there a way to get the emulator to play audio or is it all enabled also does MediaPlayer require a special kind of format like mp3 or ogg? his is the code i am running on my 'onCreate()' method.
MediaPlayer mp - new MediaPlayer();
mp.setDataSource(MY_URL_);
mp.prepare();
mp.start()

View Replies!   View Related
Motorola Droid X :: Native Android Audio Player Has A Visualizer
When the stock Android media player is playing a song, if you tap the album art box, you will discover that the Droid X has a visualizer for your viewing pleasure.

View Replies!   View Related
Android :: Audio Stops After Some Time From Video/Music Player
As mentioned audio stops after some random number of times when played from either Music/Video player. After some debugging, I found that the problem is:

In "android_audio_output.cpp"->audout_thread_func() there is a call to wait(iAudioThreadSem->Wait()) just before the while(1) and it is waiting indefinitely for something.

Can anybody tell me what is it waiting for and why is it not able to come out? From what I can understand, it is waiting for a signal (semaphore) but where is it expecting a signal from?

View Replies!   View Related
HTC EVO 4G :: STREAMING Music Player - Audio Formats
Any music player that can stream audio formats aac+,pls,m3u.asx,.ram?

View Replies!   View Related
Motorola CLIQ :: Looking For .m3u Streaming Audio Player
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 Replies!   View Related
Media :: Player That Can Handle Videos With 5.1 Audio
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 Replies!   View Related
HTC Desire :: Don't Put Audio Files In Media Player
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 Replies!   View Related
HTC Incredible :: Flash Player 10.1 - Audio Issue
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 Replies!   View Related
Motorola Droid :: Music Player Crackling Audio
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 Replies!   View Related
Samsung Captivate :: Stock Music Player 5.1 Audio
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 Replies!   View Related
HTC Hero :: Sorry The Player Does Not Support This Type Of Audio File
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 Replies!   View Related
HTC EVO 4G :: Astro Player Beta For Low Audio Output On Headphones
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 Replies!   View Related
Media :: Player To Handle MP4 AVC Files With A 5.1 AAC Audio Stream?
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 Replies!   View Related
Media :: Audio Book Or Music Player With Variable Speed
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 Replies!   View Related
Motorola Milestone :: Player Does Not Support This Type Of Audio File
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 Replies!   View Related
HTC Droid Eris :: Audio Player Application With Eq - Battery Pull
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 Replies!   View Related
Motorola Droid :: Need Player To Listen WMA Audio Books On Phone
I like to listen to audiobooks from the library. I use Overdrive, but it only allows me to download MP3's. I would like to be able to listen to WMA audiobooks, is there a player that will allow me to do this?

View Replies!   View Related
Motorola Droid :: Audio - Media Player Starts Playing By Itself
when I'm listening to audio with my headphones through cherry rplayer and then take the headphones out to use the speaker, I don't get any sound...I have to shut down any audio players functions before I get any sound out of the speaker. Not sure if cherry rplayer is the culprit or not. I have also noticed that my media player starts playing by itself...

View Replies!   View Related
Android :: Audio Native Player - Device Automatically Stops Playing Current Media
Invoked device native player to play audio file, it opens android native player on top of the application but when selecting to back out or return to the application, device automatically stops playing the current media.

Sample code:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"audio/*");
startActivity(intent);

How can I implement so that Device should continue to play audio in the background when selecting to back out or return to the application

View Replies!   View Related
HTC Desire :: Media Player Not Function Properly (Audio Jack Plugged In)
When I plug in my audio jack into my desire to listen to music with my speakers, sometimes the media player goes crazy. It skip songs, fast forward, it makes random calls. And all sorts of crazy things. I googled around, looks like quite a number of htc users face this problem too. What are your advice on this?

View Replies!   View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved