import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from fakeI2S import I2S
from machine import Pin, mem32
from micropython import const
Fs = 24000 # Sample rate = 24 kHz
BUFFER_LEN = 20 # Shorter buffer = less latency but higher processing overhead
buf = bytearray(BUFFER_LEN)
sck,ws,sd = Pin(18), Pin(19), Pin(20) # Also known as bit clock, LR clock, and data
audio_out = I2S(0, sck=sck, ws=ws, sd=sd, mode=I2S.TX,
bits=32, format=I2S.MONO, rate=Fs, ibuf=BUFFER_LEN)
print('I2S enabled')
audio_out.write(buf)
audio_out.write(buf)