Game Development Community

Changing AL_PITCH with ogg files

by Mark J A Smith · in Torque Game Builder · 05/22/2009 (12:29 pm) · 2 replies

Hi, does anyone know how to change the pitch of an ogg music and/or sound file from within TGB? I tried using alxSourcef(songHandleName, AL_PITCH, 0.5); for example, to try and play the song at half speed, but it doesn't do anything.

I know that AL_PITCH is being changed by that function call, because if I specify some AL_BLAHBLAH that doesn't exist, it complains that AL_BLAHBLAH is not a valid value to try and modify.

Does anyone have any experience with this? Do I need to open up more functions to script? I know that OpenAL supports pitch changes, but I can't seem to figure out why they aren't working for me. Maybe it just doesn't work with ogg files...but that seems rather poor.

Thanks!

#1
05/22/2009 (1:08 pm)
I tried to get audio panning working some months ago (resource link) and found out that the audio files need to be mono, 8 bit and 44KHz to get it working. Maybe this information is helpful...
#2
05/22/2009 (1:53 pm)
Wow, thank you so much!! I didn't think the solution would be nearly that straight-forward!

I've now got it working, and it honestly doesn't sound too bad having music that is in mono. I wish it would work with stereo .ogg files, but most people probably won't notice anyway. ;p