Hi all, I am using an Adafruit Itsy Bitsy M0, which has the build in DAC. I am trying to play a small .WAV file from the onboard Flash. Every DAC audio library I find seems to have some problem of incompatibilities, or flat out doesn't seem to work, like the AudioZero library.
I know the hardware is OK, because of the example code for the "SAMD21 Audio Player" by Oscar Uijl - it plays the built in Eurythmics sample.h perfectly, but I'm not sure how to adapt/use this to open a file.
Is anyone using a current audio driver to play .WAV files?
You don't need an audio library to use the SAMD21 DAC, just the analogWrite() function.
What you do need, in order to play .wav files, is a library to open those files (wherever they happen to be stored), read and convert the data to 8 bit biased samples suitable for analogWrite().
For help fixing problems with libraries, post links to the libraries, the code (using code tags) and the details of the problems, including the complete text of error messages.
In setup: DACSetup(f, n); for f Hz playback with n times oversampling (n = 1, 2 or 4).
To play audio: playSample(arrayname, arraysize);
Otherwise, most of the libraries I have found to play .WAV files state that they no longer work. e.g. GitHub - hydronics2/SamdAudio: Audio library for Atmel SAMD states " Update... an Adafruit dependency Adafruit_SPIFlash_FatFs.h is not longer available".
No, it doesn't. It reads processed audio samples from an array, suitable for sending directly to the DAC with the proper settings.
You can use the free Audacity program to read .wav files and convert them to 8 bit, 16K samples per second audio data, which would then have to be written out to a raw binary file.