PaulS
Well-known member
Been playing with a sub-$10 PCM5102 DAC board and it works well using the Audio System Design Tool.
With this minimal code I was able to output a decent sinewave:
Since this DAC can also handle 24 or 32 bit data, I was wondering whether I could use the AudioSynthWaveformSineHires object to output its 32bit data over I2S.
However the description of the AudioOutputI2S object clearly states "Transmit 16 bit stereo audio", so I guess it's not possible?
What would I need to do to make this happen? Rewrite output_i2s.cpp ?
Thanks,
Paul
With this minimal code I was able to output a decent sinewave:
Code:
// PCM5102 bd Teensy
// VCC Vin [5V]
// GND GND
// LRCK 23
// DIN 22
// BCK 9
#include <Audio.h>
AudioSynthWaveformSine sine1;
AudioOutputI2S i2s1;
AudioConnection patchCord1(sine1, 0, i2s1, 0);
AudioConnection patchCord2(sine1, 0, i2s1, 1);
void setup()
{
AudioMemory(4);
AudioNoInterrupts();
sine1.frequency(5000);
sine1.amplitude(1.0);
AudioInterrupts();
}
void loop()
{
}
Since this DAC can also handle 24 or 32 bit data, I was wondering whether I could use the AudioSynthWaveformSineHires object to output its 32bit data over I2S.
However the description of the AudioOutputI2S object clearly states "Transmit 16 bit stereo audio", so I guess it's not possible?
What would I need to do to make this happen? Rewrite output_i2s.cpp ?
Thanks,
Paul