PlaySound

Blitz3D Forums/Blitz3D Programming/PlaySound

Naughty Alien(Posted 2007) [#1]
..ok, one dumb question since I am frustrated and nervous like hell becouse of this crap..I dont know wich bit I missed, but please correct me if I did something wrong here..

;loading my stuff, geometry whatever...
.
.
.
;loading and play background music
;Environment sound
Wind_E=LoadSound("Wind.mp3")
SoundVolume Wind_E,.1
LoopSound Wind_E
Env=PlaySound (Wind_E)

;Main Loop
.
.
.
.

So, why I cant hear any sound in playback?? I can hear one short peak and after rendered image appear on screen, and after that no more any sound until when i press ESC to go out from program I hear again short peak..what did I do wrong with PlaySound? Am I missing something??


Dreamora(Posted 2007) [#2]
What is inside your mainloop? updateworld, renderworld and flip?

As well, is ChannelVolume used anywhere? (I tend to use only channel volume) because the output volume is soundvolume * channelvolume


Naughty Alien(Posted 2007) [#3]
yup..within main loop is usual stuff, update world, renderworld tween#, flip false nothing to do with sound..and weird thing I just now realized is that when i disable LoopSound Wind_E, I can hear background music but of course just one pass..soo, whats going on here???


Naughty Alien(Posted 2007) [#4]
...now, after I disable LoopSound and insert in to main loop this
If ChannelPlaying(Env) =0 Then Env=PlaySound(Wind_E)
its working fine in loop...but point is, it should be fine with LoopSound but its not...I really cant get it whats going on here..


GfK(Posted 2007) [#5]
If I remember correctly, MP3 sounds have occasional problems when used with looping. I'm sure I've had similar issues with this myself in the past.

Try converting the MP3 to WAV or OGG format and see if the results differ.


Naughty Alien(Posted 2007) [#6]
..it seems that you are right...after I did conversion to OGG and load with loopsound, its working just fine...thanks GFK..


LineOf7s(Posted 2007) [#7]
Note to self: One more reason to use .ogg