https://github.com/FrankBoesing/AudioTiming
I'm about to write a library that will allow you to influence the internal timing of the Teensy audio library.
The audio library runs at 44117Hz, not 44100. This is because the timers for the ADCs, DACs and PWM cannot be set to 44100Hz accurately enough.
As a first step, (development is still "in progress") the AudioTiming library allows to operate the timer for the ADCs and DACs pin-triggered. (PWM follows soon)
i.e. you can synchronize the mentioned IN- and Outputs with a frequency which is applied to a PIN of the Teensy. It does not matter if the Teensy generates this frequency itself or an external generator generates it.
Why this library?
- USB sound works better with exactly 44100 Hz
- ADAT requires 44100 Hz
- SPDIF works better with 44100Hz
...
- If the above objects are not used, the sample rate can now be flexible.
Hint: Fortunately, the I2S protocol used by many audio-library objects uses a so-called "framesync". This sync toggles a pin (Pin23 default) with the sample rate.
The timer for I2S is also sufficient to operate at exactly 44100 Hz.
Ideas:
- If no I2s is used, why not add a "dummy" I2S - just as frequency-generator for the lib? The FrameSync-Pin can be on the Teensy-Backside, where it less annoying if not used.
- external i2s masters can control the Audio library
@Paul - maybe some code from this library can be integrated directly into the AudioLibrary.
I'm about to write a library that will allow you to influence the internal timing of the Teensy audio library.
The audio library runs at 44117Hz, not 44100. This is because the timers for the ADCs, DACs and PWM cannot be set to 44100Hz accurately enough.
As a first step, (development is still "in progress") the AudioTiming library allows to operate the timer for the ADCs and DACs pin-triggered. (PWM follows soon)
i.e. you can synchronize the mentioned IN- and Outputs with a frequency which is applied to a PIN of the Teensy. It does not matter if the Teensy generates this frequency itself or an external generator generates it.
Why this library?
- USB sound works better with exactly 44100 Hz
- ADAT requires 44100 Hz
- SPDIF works better with 44100Hz
...
- If the above objects are not used, the sample rate can now be flexible.
Hint: Fortunately, the I2S protocol used by many audio-library objects uses a so-called "framesync". This sync toggles a pin (Pin23 default) with the sample rate.
The timer for I2S is also sufficient to operate at exactly 44100 Hz.
Ideas:
- If no I2s is used, why not add a "dummy" I2S - just as frequency-generator for the lib? The FrameSync-Pin can be on the Teensy-Backside, where it less annoying if not used.
- external i2s masters can control the Audio library
@Paul - maybe some code from this library can be integrated directly into the AudioLibrary.
Last edited: