Hello,
We are trying to create a new AudioStream class and it's not clear to us how we should convert/normalize a -1/+1 stream in the format used in the teensy audio lib.
What we tried:
for (int i = 0; i < AUDIO_BLOCK_SAMPLES; ++i) {
const float out = osc.next_sample() * 0.1f;
block->data = out * 2000.0 + 2050.0;
}
transmit(block);
release(block);
osc being a simple sine osc class for testing purposes.
Any guidance ?
We are trying to create a new AudioStream class and it's not clear to us how we should convert/normalize a -1/+1 stream in the format used in the teensy audio lib.
What we tried:
for (int i = 0; i < AUDIO_BLOCK_SAMPLES; ++i) {
const float out = osc.next_sample() * 0.1f;
block->data = out * 2000.0 + 2050.0;
}
transmit(block);
release(block);
osc being a simple sine osc class for testing purposes.
Any guidance ?