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
Related
I have created a music player using kivy. it is working fine for MP3 songs on Linux.
But when I am converting that into APK file using buildozer, then it is giving error that unable to load the file.
I am using sound loader of kivy to play the files.
This is working fine for .wav file and .ogg file. Error is coming only for MP3 files.
Any suggestions will be helpful.
Thanks in advance
Kivy only loads wav and ogg files on Android. Also make sure...
You load the sound file with kivy.core.audio.SoundLoader.load
You check if <SOUND_FILE_VARIABLE>: before you change the state of the sound because if the file doesn't exist or Kivy couldn't load the file, the sound file variable would be None
If the file is too long, the audio might be glitchy on Android.
I am trying to use one sound file with wma extension. But when I try to play it, it doesn't play. Do andengine support .wma extension files?
Sound sound = SoundFactory.createSoundFromAsset(activity.getSoundManager(), activity, "mfx/sound111.wma");
sound.play();
But it doesn't play.
Finally got the answer. I will have to use mp3 or ogg rather than wav format. Because wma is a closed format and it's support depend on some libraries not always available on Android devices, and they're not part of the AOSP (Android Open Source Project) tree itself.
Can anyone give me the sample code for parsing and playing .pls file in android?
[playlist]
NumberOfEntries=1
File1=http://stream.radiosai.net:8002/
You need to download the .pls file and read it to find the media file inside since pls is a playlist not a format.
I've been searching for a solution for 2 days about this issue and I've finally found a radio player which you can implement into your code: https://github.com/iammert/RadioPlayerService that plays .pls files from a radio service link (such as: http://stream.radiosai.net:8002/ ).
However, that url on your question should work on the default MediaPlayer but if anyone ever encounters this problem with urls that contain a .pls file, then they should use a radio player that supports the encoding and format.
.
When I download MP3 files with my app they go to the download folder and when I navigate there and try to play them I get content not supported. I have looked around a little bit, but can't figure out why. Anyone know how I can fix this, is it something with the MIME types? What does this do:
connection.setRequestProperty("Content-Type", "audio/*");
MP3 • Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate
(VBR) MP3 (.mp3)
Android Supports MP3 in the above format. Incorrect encoding makes this type of error. Also check to see if the extension and file names are proper. Because some downloaders may name the file like mywebsite.com-mysong.mp3. The android OS may wrongly interpret the file as a .com file rather than a .mp3 file.
Reference:
http://developer.android.com/guide/appendix/media-formats.html#core
Please ensure you save with the .mp3 extension. sometimes it can get lost along the way.
I am looking to develop an application where I have to stream .m3u file, this is for ANDROID 3.0 only.
I want to stream this link
dl.dropbox.com/u/2377944/test/abr_test/index.m3u8
it must work in emulator too
I searched a lot, but nothing seems to be working too good.
Please help.
Thanks in advance.
m3u is a play list format, a text file, and not actually audio/video media itself. That means it references media that you would want to stream. The distinction is important.
The contents of the m3u file is important. (Your link is dead, btw.) Show that to use and we can help more. Each of the media files contained in the m3u must be valid and point to media that is compatible with Android.
What makes the media compatable? Check the Android Supported Media Formats page.