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.
Related
I made an app where a user can take multiple videos and concatenate them together using FFmpeg concat. I added an export video feature where you can export your concatenated video to your Gallery on your Android device. Currently I am using Expo Media Library but I am having issues with large files. It doesn't have to be a very large file. Ex. a 4-5 min. mp4 video recorded in 720p makes the MediaLibrary.saveToLibraryAsync() and MediaLibrary.createAssetAsync() functions to hang and eventually throw a generic exception Unable to save file to external storage. With smaller files I have no issues. Is there another way to copy a video file from the app folder to the Gallery/External Storage?.
Found a solution with the help of #blackapps, I am not sure if its a good solution but it is currently working for me.
import RNFS from 'react-native-fs';
const path = RNFS.ExternalStorageDirectoryPath + "/DCIM/video.mp4";
I am using the React Native File System library and I am directly generating my video file to the DCIM folder located at /storage/emulated/0/DCIM.
This only works through the FFmpeg command. If I try to copy the video to the DCIM folder with the File System library I will get an exception: Its not writable
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.
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 add sound to my Libgdx game using a wav file. It is supposed to play in the background of the main menu and loop but for some reason it does not play. Does anyone have any insight into way this may be. I also notice in the logcat that soundpool is not ready. I have added the following code to the constructor of my screen and the file is located in my assets folder. Thanks.
Sound wavSound = Gdx.audio.newSound(Gdx.files.internal("sound.wav"));
wavSound.play();
Make sure the file extension is named correctly and that the file is encoded in the proper format.
Renaming sound.mp3 to sound.wav will trigger a SoundPool: Not Ready error.
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