[Openal] Square wave with different frequencies

etxmato mvt at hammarbysjostad.se
Thu Sep 6 06:38:24 PDT 2007


Hello,

I'm new to openAL and fairly new to sound programming as well, so please
forgive me if this is going to be a silly or simple question. 

I need to be able to generate square wave sounds of different frequencies
ranging from 43 Hz to ~700KHz. My initial plan was to use openAL, create a
simple buffer with a square wave and change the frequency as needed. When
started I realized that changing the frequency of a buffer is not really
possible after it has been created with alBufferData and linked to a source.
So I opted for changing the pitch as needed by setting the pitch to (needed
frequency)/(buffer frequency). Got some results but after some searching on
the net I found out that I can't really do this either as the pitch should
not be less than 0.5 and/or more than 2 in most implementations.

So now my question is, does anyone have any recommendation on how to
generate wave sounds (in my case a simple square wave is needed) with
different frequencies. i.e:
- Do I need to have 1 buffer for every frequency I might need? 
- If so how many buffers can I create? would it be ok to create around 1000
(small) buffers?
- Are there any other ways of changing the frequency of a specific sound
buffer or source+buffer?
- Maybe I should use another sound library?

Hope someone can put me in the right direction,
Chees, Marcel.
-- 
View this message in context: http://www.nabble.com/Square-wave-with-different-frequencies-tf4391417.html#a12520312
Sent from the OpenAL - User mailing list archive at Nabble.com.



More information about the Openal mailing list