I have used the following code: the mp3 is saved in the mobile sdcard.
notification.sound = Uri.parse("file:///sdcard/File/sdcard/introduction_file.mp3");
do you know how a mp3 file can be played as an application recources and not from the sdcard?
thank you
See android guide for playing from raw resource.
Related
I'm testing the demo at,
http://docs.gstreamer.com/display/GstSDK/Android+tutorial+5%3A+A+Complete+media+player
I only changed the permissions to allow reading from the SD card, and when I try to play a MP3 file, it says, amcaudiodec-omxgooglemp3decoder0: Internal data stream error. Any idea how to fix this?
Thanks!
Edit: Ogg files work fine.
I am going to be downloading audio files to the device's internal memory. At a later time I would like to play this audio with a MediaPlayer. In the "Media Playback" guide on the developer site it mentioned using a "URI". Is there any way I could just use the filename of the file in the internal memory? How can I play saved audio?
To get the URI from a file path this may help:
it looks like
Uri.parse(new File("/sdcard/cats.jpg").toString()) should do the trick.
I am trying to play an .pls file (available at http://stream.radiosai.net:8002/listen.pls) in android 2.2. But it isn't working. Playing MP3 works fine.
A pls or a playlist file is basically a text file with the path of each track in each entry. Kind of like an .ini file. Take a look at the WP entry.
I don't think the inbuilt MediaPlayer supports these formats, so you'll have to download the file and parse the file and play the actual mp3's one by one.
Android doesn't support the .pls format. Link
i have this problem, i create a app, in this app i record audio ogg file, i store file in memory (i see the file using DDMS) ,
when i wont to play the file audio i have a error
in this link you can see the source
main:
http://pastebin.com/PWE9FsxT
android manifest:
http://pastebin.com/p39J1Y6i
logcat
http://pastebin.com/ktyFWPXq
please help me
Best Regads
Antonio
This error comes because sometimes mediaplayer is not ready , put a condition before playing a
sound so that sound will play when media player is completely released .
How can I make my app set a mp3 stored in the SD Card as a ringtone? my app uses android 2.1+?
Thanks :D
Here you go. :)
http://www.ceveni.com/2009/07/ringtone-picker-in-android-with-intent.html