Re: Loading arrays into register
Re: Loading arrays into register
- Subject: Re: Loading arrays into register
- From: "tahome izwah" <email@hidden>
- Date: Sat, 29 Dec 2007 09:52:45 +0100
I would second what Ian just said.
As for getting the project to compile and produce some meaningful
results - why don't you get rid of the arrays and create the sine wave
on the fly:
float mCounter; // declare this as member in the class and set it to
0 before using it
// this should go where you need the sine wave, it produces one sample
of the sine wave at a time
float sine = sin(2.*M_PI*frequency*mCounter++/sampleRate + phase);
frequency is the frequency in Hz
phase is usually 0, unless you want to start the sine wave later in its period.
sampleRate is your playback sample rate
Note that the precision of sin() gets worse with increasing argument,
so your sine wave will start to distort after a couple of minutes. But
at least you have something to work with.
HTH,
--th
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden