1 #define DR_WAV_IMPLEMENTATION
2 #include "../../dr_wav.h"
8 float a = 1.0f / sampleRate;
12 for (iFrame = 0; iFrame < frameCount; iFrame += 1) {
13 float s = (float)(sin(3.1415965*2 * x * frequency) * 0.25);
14 for (iChannel = 0; iChannel < channels; iChannel += 1) {
15 pOutput[iFrame*channels + iChannel] =
s;
29 float tempFrames[4096];
35 printf(
"No output file specified.\n");
45 printf(
"Failed to open file.\n");
50 totalFramesWritten = 0;
52 while (totalFramesToWrite > totalFramesWritten) {
53 drwav_uint64 framesRemaining = totalFramesToWrite - totalFramesWritten;
55 if (framesToWriteNow > framesRemaining) {
56 framesToWriteNow = framesRemaining;
62 totalFramesWritten += framesToWriteNow;