SoundBoard Problem! Need quick help!

All your problems with Audio, Video and Images.

SoundBoard Problem! Need quick help!

Postby klix666 » Wed Jun 08, 2011 1:59 am

Hey, I'm slightly new to android/java. I'm making a soundboard. I have the layout and everything completely done. Now I'm trying to get the actions down. Here is what I'm trying to use to make a button make a certain .mp3 play. tom.mp3 is a test file.

if (items[position]=="Tom")
{
MediaPlayer Speech = MediaPlayer.create(this, R.raw.tom);
speech.start();
}
After it worked once, I replaced the test file tom.mp3 with the real file I wanted to use.

if (items[position]=="Tom")
{
MediaPlayer Speech = MediaPlayer.create(this, R.raw.tomfinal);
speech.start();
}
I put into emulator and clicked the button "Tom" and it still plays the tom.mp3 sound file, not the tomfinal.mp3 file. Someone please help, please show me how a clean and working sound mediaplayer code.

Thanks!
klix666
Freshman
Freshman
 
Posts: 4
Joined: Wed Jun 08, 2011 1:53 am

Top

Re: SoundBoard Problem! Need quick help!

Postby abhijitphatak28 » Wed Jun 08, 2011 6:14 am

Few points you need to check is :

Your application is compiled properly after changing the code. You can clean the earlier version and rebuild it.
Also, you can check if both the files are not same.

If still it doesnt resolve your problem then remove tom.mp3 from res folder and see what song it is playing then. If you remove tom.mp3 from res folder you would get compile time error if that file is still referenced at any location.

Thanks

Regards
-Abhijit
User avatar
abhijitphatak28
Senior Developer
Senior Developer
 
Posts: 102
Joined: Sat Feb 12, 2011 1:18 pm
Location: Indore

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests