Sound commands closing blitz randomly...

Blitz3D Forums/Blitz3D Programming/Sound commands closing blitz randomly...

Damien Sturdy(Posted 2004) [#1]
Hey peeps.. was having a few issues with my code below... it wont run alone so dont try. Just wondering if anyone has ever had an issue like it?

"sound 1,1,100,1" works.
"sound 2,1,100,1" works.
"sound 3,1,100,1" fails

What happenes, is that at the marked two lines, the program just shuts down, no error or anything.


Could this be an Fmod error?

If anyone has any ideas, please help.. this is a realy anoying bug in the system :/


Function addSound(channel,vol#,Pitch,Length)
Local p2#=pitch+200,o=channel
chancheck(channel)=0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If sounds(channel)<>0 Then
f = 440 * 2^(((P2/4.0) - 58)/12)
p2=f
If p2>100 And p2<44101 Then
SoundVolume sounds(channel),0

If ChannelPlaying(schan(channel))=0 Then schan(channel)=0
If schan(channel)=0 Then schan(channel)=PlaySound(sounds(channel)) ;Error causing line

ChannelPitch schan(channel),P2
ChannelVolume schan(channel),1
SoundVolume sounds(channel),1
volume(channel)=vol
sLength(channel)=Length
started(channel)=soundtimer()
release(channel)=-.3
sustain(channel)=.5
decay(channel)=-.2
EndIf
EndIf
updatesound()
.endbit
End Function




Wayne(Posted 2004) [#2]
Post all code so we can reproduce the error would be a big help. Also what sound card are you using?


Damien Sturdy(Posted 2004) [#3]
i have a "terratec 5.1 fun."
I would post all the code, and i have no problem doing so, as it is my procedural coding project. il be back in 5 actually, as i have pizza arriving :D


Damien Sturdy(Posted 2004) [#4]
---


Damien Sturdy(Posted 2004) [#5]
ookay i sorted it- It was a flaming dreaded Stack Overflow that wasnt reporting itself. that was a puzling one!


BlackD(Posted 2004) [#6]
hey cyg - how are u creating sounds without using any libraries or file saves?


Damien Sturdy(Posted 2004) [#7]
i am creating a quick external file... create a quick .wav containing a simple Square wave, then load it in as a sound and delete the file.

That against the rules now? i thought it wasnt.. and if it is, i just wasted almost half a week >.<


Ross C(Posted 2004) [#8]
No, as long as the files are produced by the source code, and the source code orginally has nothing no external files to load in :o)


Damien Sturdy(Posted 2004) [#9]
program creates file, then program goes loadsound("createdfile.wav") and then deletes createdfile.wav.

so i should be okay. Threads getting off topic now. hehe..

Anyone else get the type of error i get here then? blitz just shutting down without error?