Guest User

Untitled

a guest
Feb 13th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. short int* samples = new short int[44100 / 24 * 23];
  2. static int framesSinceLastPrint = 0;
  3. const int framesInBetween = 1;
  4. framesSinceLastPrint++;
  5. if (framesSinceLastPrint == framesInBetween)
  6. {
  7.     framesSinceLastPrint = 0;
  8.     const int numSamples = 44100 / 24 * framesInBetween;
  9.     for (int i = 0; i < numSamples; ++i)
  10.     {
  11.         samples[i] = std::sin(i / 44100.f * 2 * 3.1415f * 440) * 32767;
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment