Android sound compilation issue

Monkey Targets Forums/Android/Android sound compilation issue

4mat(Posted 2011) [#1]
Having a problem getting my game to compile on Android with the sound code enabled. While I can get Flash, HTML5 and GLFW to work fine it doesn't seem to like the way I'm using audio on this device. I can run the audiotest.monkey file fine on the emulator however. I'm quite a 'traditional' Blitz programmer so it's all Functions and Arrays for me rather than anything more complex, not sure if that's to do with the problem. The audio files are loaded into an array during the init, when playing sounds back I just inc a variable to choose a new channel. (and then it resets after 31 channels have been activated)

Anyway, my source does this: (probably some formatting errors)



And here's what I get:



Commenting the audio lines out compiles fine. (though there's another error on boot up but I'll save that for later :) I know a few of these commands aren't supported on Android (I imagine they're just stubs there) but any help with the Load and Play would be useful. Thanks.


dave.h(Posted 2011) [#2]
heres the function i use to play all my sounds and ive no probs with it.

Function psound(snd:Sound)
PlaySound (snd,channel_counter)
channel_counter +=1
If channel_counter > 30 channel_counter = 0
End

to call it just type psound(mysound)
mysound is the sound you wish to play and it then increments the channel counter ready for the next sound.There may be better ways to do this but it works fine for me


skid(Posted 2011) [#3]
Have you tried deleting your game.build folder?


4mat(Posted 2011) [#4]
Yep, did that a few times while trying to fix it.


skid(Posted 2011) [#5]
Ha. This line of the error:

bb_audio[bbt_g]=bb_audio.bb_LoadSound(bbt_temp);

suggests you are confusing it considerably by calling your array audio which is seemingly conflicting with the module of the same name.

Mark should fix this but in the meantime, try using a different name for your array .


4mat(Posted 2011) [#6]
Wonderful, that's fixed it. Thanks.