Skip to content

stream protocol for I2SIn#11064

Open
FoamyGuy wants to merge 1 commit into
adafruit:mainfrom
FoamyGuy:audioi2sin_streaming_protocol
Open

stream protocol for I2SIn#11064
FoamyGuy wants to merge 1 commit into
adafruit:mainfrom
FoamyGuy:audioi2sin_streaming_protocol

Conversation

@FoamyGuy

@FoamyGuy FoamyGuy commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This allows audioi2sin.I2SIn to be used in effects chains with various audio modules, and to be piped to an output source like AudioOut or USBMicrophone. Prior to this change I2SIn has only a simple record() API.

I tested with this basic code that passes audio from the I2S mic to USB as a microphone to the host computer, turning the MCU into a functional USB microphone.

import board
import audioi2sin
import usb_audio

usb_mic = usb_audio.usb_microphone

with audioi2sin.I2SIn(board.D5, board.D6, board.D9,
                      sample_rate=16000, bit_depth=16) as i2s_mic:

    usb_mic.play(i2s_mic)

    try:
        while True:
            pass
    except KeyboardInterrupt:
        pass

I also successfully tested a version with a handful of effects between the input and output so the device acts as a voice changer. I verified the original record API .wav file example works as expected as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant