I am beginner with Android Studio. I have an MP3 file in my res\raw
folder. When I sync project with Gradle files
. I get the following dialog box:
How do I allow for MP3 files in my project?
I read this: Register new file type in Android, but I'm not building an MP3 player. My intention is for the user to have an MP3 player currently installed on their device.
I also tried navigating to File -> Settings -> Plugins
and searching for an MP3 player for Android Studio.
Should I just select Text files
and move on?
I do not need Android Studio to play MP3 files.
Then go to File > Export Audio and choose the location to save the file, give it a name, and choose MP3 as the file type. If you're a more advanced user, you can choose the audio quality and stereo settings. You will get a screen asking if you want to type in any metadata for the file manually.
MP3 (MPEG-1 Audio Layer-3) is a standard technology and format for compressing a sound sequence into a very small file (about one-twelfth the size of the original file) while preserving the original level of sound quality when it is played. MP3 files (identified with the file name suffix of ".
That window is just how you want Android studio to open the file so you can visualize/listen to the file. It does not affect how the file is handled by android at all.
Since Android Studio does not have a media player, I suggest you to select Open matching files in associated application That will launch your default music player and play that mp3.
Note: remember that all the files under res should ONLY contain lowercase letters, numbers and underscores. If you have your mp3 with the wrong name conditions will not compile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With