Is there a way to support USB Audio via CircuitPython, writing to the DAC on the microcontroller (where this is supported in hardware)? My ItsyBitsy M4 shows up with:
I don't think I've seen this type of usage before. Are you trying to use your ItsyBitsy M4 as a USB Audio device when plugged into a linux box? If so, I don't see a way to do that.
You can write audio files to the DAC, but the code would have to be loaded onto the ItsyBitsy M4 something like this:
import time,random,board
from audiocore import WaveFile
from audioio import AudioOut as AudioOut # only DAC
wave_file = open("laser20.wav", "rb")
wave = WaveFile(wave_file)
audio = AudioOut(board.A0) # must be DAC-capable pin, A0 on QTPy Haxpress
while True:
print("audio is playing:",audio.playing)
if not audio.playing:
audio.play(wave)
wave.sample_rate = int(wave.sample_rate * 0.90) # play 10% slower each time
time.sleep(0.1)