Playing Audio File from Raw Resources

Posted by Unknown Senin, 04 April 2011 0 komentar
We'll share some info on how to play audio or video which can be stored in application's resource folder (res > raw).


Step 1: Put the audio/video file in (res/raw) folder of your project. If the "raw" folder does not exist, create one.
Step 2: Put in the following code:-


Private MediaPlayer mp;

mp = MediaPlayer.create(this, R.raw.audiofilename);
                    mp.setLooping(true);
                    mp.start();

Note:-
1. Change the audiofilename according to your own audio file name.
2. When you mp.setLooping(true), the audio file will play continuosly until you stop it.

Roger,
mytikus
TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Playing Audio File from Raw Resources
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke https://androidemoticonss.blogspot.com/2011/04/playing-audio-file-from-raw-resources.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android emoticons.