what i got is a basic sine wave generator, I will have to modify it so it will generate sound from 100Hz to 4000Hz in 5 seconds.
if(!GenerateBegin())
return;
short audio[1];
for(double time=0.; time < 5; time += 1. / m_sampleRate)
{
audio[0] = short(m_amplitude * sin(time * 2 * M_PI * m_freq1));
GenerateWriteFrame(audio);
// The progress control
if(!GenerateProgress(time / 5))
break;
}
// Call to close the generator output
GenerateEnd();
any help will be appericiated :D
Aucun commentaire:
Enregistrer un commentaire