[Openal] Square wave with different frequencies

etxmato mvt at hammarbysjostad.se
Mon Sep 10 01:38:32 PDT 2007


Hi Again,

Peter/Jason, thanks for your suggestions! For now I have stuck to openAL as
doing the same with PortAudio to me looks more difficult (maybe as I haven't
studied that as much as yet). Also I need to have two sounds possible at the
same time i.e. a square wave and white noise which I'm not sure how to do
via PortAudio.

My next question:
> In case you don't know, there is a function in ALUT that will generate 
> square waves for you:

>  alutCreateBufferWaveform(ALUT_WAVEFORM_SQUARE, frequency, phase, 
> duration).
I have managed to use the alutCreateBufferWaveform with a square wave, works
very handy! However now I want to do the same for white noise with:
alutCreateBufferWaveform (ALUT_WAVEFORM_WHITENOISE, frequency, phase,
duration). However I get no sound in this case!?

I understood from the documentation that for white noise the frequency and
phase are discarded, and for duration I have used 1 second (also tried a few
higher values). The alutInit does not give any error and i use the same
structure as for the square wave. If I replace the ALUT_WAVEFORM_WHITENOISE
with ALUT_WAVEFORM_SQUARE I do get square wave sounds but with the
WHITENOISE just some short 'tick'....

Anyone any suggestions for what I might be doing wrong?
Has anyone managed to run this with white noise?

Cheers, Marcel.
-- 
View this message in context: http://www.nabble.com/Square-wave-with-different-frequencies-tf4391417.html#a12588834
Sent from the OpenAL - User mailing list archive at Nabble.com.



More information about the Openal mailing list