0
0

Hello,

I’m new with FMOD, and I want to use it to experiment with home made waveforms. I started with trying to play a 1s sine wave of 880 Hz, but it doesn’t work. Here’s my code:

//***************************************************
for (int i = 0; i < 44100; ++i) {
samples[i] =
floor(10000sin( 2(3.141592)880(i/44100) ));
}

mysample = FSOUND_Sample_Alloc(FSOUND_FREE, 44100,
FSOUND_NORMAL, 44100, 255, 128, 255);

FSOUND_Sample_Upload(mysample,samples,FSOUND_NORMAL);

FSOUND_PlaySound(FSOUND_FREE, mysample);
//***************************************************

Can someone tell me what I am doing wrong?
Thanks in advance,
Bert

  • You must to post comments
0
0

Have you Initialized FMOD using FMOD_INIT

  • You must to post comments
0
0

Oops… I think I did something very stupid. i/44100 == 0 because i is an integer. I replaced 44100 with 44100.0 and now it works just fine. Sorry.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.