Playsound "pitch" question

BlitzMax Forums/BlitzMax Beginners Area/Playsound "pitch" question

kronholm(Posted 2006) [#1]
Heya, was wondering if anyone got any input on this little problem..

Is it possible in BlitzMAX, to play a sound at a different pitch? For instance playing a sound that lasts 2 seconds at a lower rate, making it last 4 seconds?
I want to use it for a matrix-style effect in a game, where the time slows to 1/60th, so the music and the sounds should be played back at that rate as well. Think Burnout "pause" mode.


tonyg(Posted 2006) [#2]
Is it setchannelrate?


Booticus(Posted 2006) [#3]
Yes! Example

SetChannelRate thenoisechannel,Rnd(0.6,1.0)

will make it play in random pitches.


kronholm(Posted 2006) [#4]
Any way to detect which channels are playing?


Yan(Posted 2006) [#5]
->ChannelPlaying()<-


kronholm(Posted 2006) [#6]
That will only work if you know the name of the channel.


Booticus(Posted 2006) [#7]
Local thename:String="computernoise1.ogg"
IncBin "computernoise1.ogg"
Global readoutnoise:TSound = LoadSound( "incbin::"+thename, True)
Global readoutnoisechannel:TChannel =CueSound(readoutnoise )
SetChannelVolume readoutnoisechannel ,0.25
PauseChannel readoutnoisechannel


Thats how I have mine set up. Load the sound, name the channel, then you can start playing with it.


Yan(Posted 2006) [#8]
That will only work if you know the name of the channel.
You're obviously too clever for me...


kronholm(Posted 2006) [#9]
I should've been more clear when asking that question.
I want a way to detect which channel is playing, when I don't know the name. I.e. knowing what it defaults to when naming the channels automatically, or some sort of way to 'list' it.

Until that, your suggestion will work just fine Booticus, thanks :)


Booticus(Posted 2006) [#10]
No problem!