I tried to add a mp3 song to android, exactly like this explanation, but it's not recognizing my mp3 file as sound, and shows me this error message:
Try putting the mp3 file in assets folder.
Please clear the empty characters in the filename.
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.
Iam a learner of creating android custom app. I create simple app using HTML files via Quick-App-v1.1. I have include the audio file in html file. it's properly play when open the HTML file in browsers, but when create the app the audio file not playing. Please advice me.
Create a folder in Android Studio under 'res' and name it 'raw'.
Copy your audio file to the raw folder.
To play the audio file you can use something such as:
MediaPlayer song;
//then play it inside your onCreate
song = MediaPlayer.create(this, R.raw.YOUR_SONG_NAME);
song.start();
Check this out:
http://developer.android.com/reference/android/media/MediaPlayer.html
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
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.
In my code i am using VideoView and MediaController for playing my audio/video files. The problem is that I need to place my audio/video files in assets folder but i am not able to play the audio/video files when placed in assets folder and give path as "file:///android_asset/audio.mp3". I get this error "Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported". But the same code runs when i place my audio/video files in sdcard and give its path(/sdcard/audio.mp3). Does this mean that i cannot play audio/video files when placed in assets folder? Thanks in advance.
Your path is wrong.
For playing audiofiles from the assets directory, you have to follow the advice in the similar question here.