Background music

78 views
Skip to first unread message

Ilari Ristola

unread,
May 12, 2015, 3:46:40 PM5/12/15
to androi...@googlegroups.com
Hi,
I working with little airplane-game, main element are almost ready. I try to make some background sound/music from my own sd, but have problem get it out. Play also little guitar riff and convert it to mp3 :)
What is the script i looking for?

Sorry, for poor english. ;)

Chris Hopkin

unread,
May 14, 2015, 4:04:58 AM5/14/15
to androi...@googlegroups.com
Hi Ilari

Audio files can be played using the MediaPlayer object:

player = app.CreateMediaPlayer();
player
.SetFile( "/Sys/Snd/Poing.ogg" );
player
.Play();

Also see the 'Audio Output' and 'Audio Player' samples.

To use your own audio files you have uploaded to your Apps Sound assets section in the Wifi IDE, the file path must start with 'Snd/', e.g.

player.SetFile( "Snd/mymusicfile.mp3" );

Thanks

Chris

Ilari Ristola

unread,
May 17, 2015, 7:25:50 PM5/17/15
to androi...@googlegroups.com
Thx Chris,

Sound problem solved.
Got another question. I need to slow down background bmpW and other stuffs, also think that i simple slow fps, but not sure about that. Already made pop-up button what show up after landing as brake. I try some (if) methods, but not get much clear. It should slow down as touch to touch. Any thoughs?

- Ilari

Chris Hopkin

unread,
May 18, 2015, 4:15:04 AM5/18/15
to androi...@googlegroups.com
Hi Ilari

Could you post your code to help explain what you are trying to do?

If you have a scrolling background image that you want to slow down, you should reduce the amount that the position updates each frame rather than changing the FPS. Once we see the code we will have a better idea about what to suggest.

Thanks

Chris
Reply all
Reply to author
Forward
0 new messages