Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sampleRate = 8000;
- short[] buffer = new short[8000];
- double amplitude = 0.25 * short.MaxValue;
- double frequency = 1000;
- for (int n = 0; n < buffer.Length; n++)
- {
- buffer[n] = (short)(amplitude * Math.Sin((2 * Math.PI * n * frequency) / sampleRate));
- }
- d= 40000; //fundamental freq of sine/sample rate
- for (int n = 0; n < d; n++)
- {
- buffer[n] = (short)(amplitude * Math.Sin((2 * Math.PI * n * ) / d);
- }
Add Comment
Please, Sign In to add comment