OpenAL - Varying Pitch (for an engine sound)
Using OpenAL, have any of you done any work to vary the pitch of a looping sound to mimic an engine running at different speeds?
Yeah, it's easy. There is a source property you can use to set the relative pitch.
Code:
alSourcef(source, AL_PITCH, 1.0f)Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
And changing that in real-time at any point when a source is playing, (not just on the boundaries of a loop, for instance) doesn't lead to any popping sounds or nastiness?
Got around to trying it myself now. It works fine, even while a source is playing. Yay!
I have been trying to use AL_PITCH to change the pitch of car engine sound.
It is changing the pitch but the effect is very abnormal; it is not realistic at all.
Is there any suggestion from you on how do i change the pitch so that it mimics the engine sound going up and down as the speed increases or decreases respectively in a smooth way.
I will be very thankful for any sample codes and tutorials to accomplish this task.
Thanks in advance.
It is changing the pitch but the effect is very abnormal; it is not realistic at all.
Is there any suggestion from you on how do i change the pitch so that it mimics the engine sound going up and down as the speed increases or decreases respectively in a smooth way.
I will be very thankful for any sample codes and tutorials to accomplish this task.
Thanks in advance.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenAL looping sound problem | Gillissie | 0 | 3,020 |
Sep 16, 2010 12:31 AM Last Post: Gillissie |
|
| OpenAL - sound disappearing | Madrayken | 3 | 3,874 |
Jan 19, 2010 03:22 AM Last Post: Madrayken |
|
| sound file formats in OpenAL | unknown | 7 | 6,014 |
Nov 6, 2005 12:50 AM Last Post: Skorche |
|

