posted this on February 26, 2012 01:46 pm
Hi has anyone used sound with the sifteo cubes? I am not very familiar with programming in C# and am hoping some one may be willing to post some simple source code for sound?
The way I've been doing it, which has been successful but I'm not sure how good it is style-wise, is to initialize a Sound object at the very beginning of the program, before Setup() is called. Something just like: Sound testSound;Then, inside Setup(), you actually create the Sound object based off of the audio file you have in assets/sounds:
testSound = Sounds.CreateSound("test");Finally, when you actually want to play the sound, use this method: testSound.Play(1,0);The first argument must be a 1, I think, but the second argument is a 0 if you'd like the sound to play once, or a 1 if you'd like the sound to loop. The rest of the documentation on sound with Sifteo can be found here: http://developer.sifteo.com/class_sifteo_1_1_sound.html. I hope this is enough to get you started.
Support Ticket System by Zendesk