simple question

All your problems with Audio, Video and Images.

simple question

Postby barodapride » Wed Dec 01, 2010 3:49 am

Hey guys, I'm trying to play a midi file that is located in my res/raw folder (just like in the tutorial).

The name of the midi file is test (just shows up as test on my computer but when i copy it to the raw directory it changes to test.mid). This is the problem line in my code (basically from the media player tutorial)

MediaPlayer mp = MediaPlayer.create(context, R.raw.test.mid);

this statement doesnt work because test.mid is invalid. Is there a way to do somethine like "test.mid". that will cause the compiler to ignore the '.' ?
barodapride
Junior Developer
Junior Developer
 
Posts: 23
Joined: Sat Sep 25, 2010 4:43 am

Top

Re: simple question

Postby barodapride » Wed Dec 01, 2010 6:43 am

nevermind i got it.

the name of midis has to be in the format xxx.mid

then you can call it using r.raw.xxx
barodapride
Junior Developer
Junior Developer
 
Posts: 23
Joined: Sat Sep 25, 2010 4:43 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 11 guests