sound stops occasionally

Monkey Forums/Monkey Programming/sound stops occasionally

dave.h(Posted 2011) [#1]
every now and again the sound will stop in my game.ive noticed that other peoples apps will do this as well.is there any way to check it and get it going again .


Cheese(Posted 2011) [#2]
It would probably we wise to post this within the forum for the specific platform which you're having this issue. I'm assuming you're talking about HTML5, but most people aren't browsing this category to troubleshoot HTML5-specific problems.

You should also post example code that replicates this issue and elaborate further concerning exactly when the problem occurs.
For example: are you talking about a pause upon looping, or does it occur randomly?

- Brandon.


dave.h(Posted 2011) [#3]
its not specific to any platform as far as i can tell and there doesnt seem to be any way i can replicate it as its completly random.Initially it happened a lot and i thought it had something to do with the amount of resources i was using.I was using around 30 small spritesheets and about 6 sounds.When i put all the spritesheets into one large PNG file and used
drawimagerect then it happens far less often.Also i was then able to use Playsound on android but couldnt before.
My code for calling all sound events is

' THIS FUNCTION PLAYS A SOUND THAT IS PASSED TO IT THEN INCREMENTS THE 'CHANNEL_COUNTER READY FOR THE NEXT SOUND.IF THE CHANNEL_COUNTER GOES ABOVE '30
' THEN IT RESETS THE CHANNEL_COUNTER TO ZERO

' USAGE psound(snd)

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


It does seem to do it more in HTML5 than android but maybe thats because i test it more in that.


Midimaster(Posted 2011) [#4]
I have also big problems with sounds....

i am peter from midimaster. we producing music education software and want to do it with monkey too, but at the moment we canceled this because of big problems with these random sound bugs.

I published here an app "MokeyPiano" to get feedback about those problems from other users, but no single comment....

Our impression is, that the channel managment does not work correct. If you play the MonkeyPiano you can hear, that sometimes sounds become louder than others. This is because the old sample seems to be "added" to the new one. And you also can hear, that sometimes channels don't play any more. In the MonkeyPiano you can watch, which channel is used at the moment an you can see, that the same problem happens always with the same channel.

It would be very nice, if the community would check this behavior and report their experiences on other computers.

to precisize it: The sounds on MonkeyPiano all have the same volume and do not overdrive. Also they have no latency and no repetition. But that is not what you can hear....


therevills(Posted 2011) [#5]
but no single comment....


I think a lot of people dont know or dont read the app forum, I've found it better to publish an app here and create another thread in Monkey Projects...

Have you tried with v40? Sound is getting better.... slowly...


dave.h(Posted 2011) [#6]
I agree that v40 is much better and has solved most of my earlier problems
especially on the android side but have noticed what Midimaster said still holds true.
My sounds do increase in volume if i play it more than once.I havent noticed that


dave.h(Posted 2011) [#7]
didnt finish last post lol

i havent noticed that occasionally some sounds dont play but i have found that they are sometimes delayed . I think my biggest worry is getting complaints back that the sound just sometimes stops which in turn could lead
to getting a bad name for yourself.Maybe im worrying to much as it is a rare problem now.


dopeyrulz(Posted 2011) [#8]
The sounds does seem to have improved from earlier versions - on XNA previously playing music (to loop), playing new music (pauses the first music) and at the end of this returning back to the first music used to crash (some sort of object already disposed error from memory - hadn't had a chance to raise it yet) - doesn't do it anymore in v40 :)

Also a quick check on HTML5 appears to be also working better with sounds.


Midimaster(Posted 2011) [#9]
sorry, but i tested the MonkeyPiano with V40: No improvement, the channels have the same problem under HTML5. "Getting complaints back..." was also for us the reason to interupt developing with Monkey. Complaints are an absolut "No Go"!


therevills(Posted 2011) [#10]
the same problem under HTML5.


Are you actually going to "ship" a HTML5 application though? What about the other targets?

I only use HTML5 as a prototype target as it is quick to build and run, but I wouldnt use it in a production environment...


dave.h(Posted 2011) [#11]
good point as its initially android i was aiming for. I just surmised it would happen on all the targets but thats not the case as android does seem to be much better now