Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRyan Brienza
1,579 Pointshow do you import sound files like mp3 or waw files into android studio?
I just need some help for a project i want to work on
1 Answer
Gunjeet Hattar
14,483 PointsHi Ryan,
For that you first create a directory inside your res directory. By default we call this new directory raw, since it contains raw files like mp3. Right now dragging and dropping has some issue in Android Studio, so you'll have to manually go the folder where your project is and create copy paste the file to the raw directory.
Inside your code use the MediaPlayer method to access and call your mp3 file and play it Android Media Player
Hope this helps. Ask again if you have doubts