ap-atul / music_player_lite

An elegant and lightweight music player for android
The Unlicense
119 stars 22 forks source link

Files stored in the raw/assets folder #37

Closed abdulbasid123 closed 1 year ago

abdulbasid123 commented 1 year ago

How can I retrieve the audio files saved/stored in the raw/assets folder of the app (even it means to exclude Artist and Album out) ?

I want to build an app that will play only the audio files stored in the raw folder, but in a playlist and customize uis like (Music Player Lite).

I have downloaded the Music Player Lite code and able to edit and even customize the uis better, I don't know how to make it retrieve the raw files.

Any one could help me ? Or direct me to a link ?

ap-atul commented 1 year ago

This should work I guess

MediaPlayer mPlayer = MediaPlayer.create(context, R.raw.soundclip);
mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mPlayer.start();