Sound Error

Blitz3D Forums/Blitz3D Beginners Area/Sound Error

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

When I use StopChannel I get a 'Memory access violation' error. How do I fix this?

Here's the code:

	If PLAYING% = False
		PlaySound MAIN
		LoopSound MAIN
		PLAYING% = True
	EndIf
	
	DrawImage cursor, MouseX(), MouseY()
	
	If ImagesOverlap(CURSOR2, MouseX(), MouseY(), PLAY, 235, 180)
		If MouseDown(1) = True Then PLAY = True
		If MouseDown(1) = True Then StopChannel MAIN
	EndIf


While i'm on the subject, how do you play MIDI files? I used playsound but it doesn't work.