Repository navigation
sounddevice #6978
|
Some real-time audio decoding requires analyzing audio frames instantly as they come in, Flet recorder may not be adequate. Will this be included? |
Replies: 1 comment
|
Thanks for the request. We looked into this in depth, and for now we're not shipping sounddevice for mobile. sounddevice is a thin wrapper around PortAudio, the C audio library, and upstream PortAudio has no Android or iOS backend. Two community PRs exist, Oboe for Android and RemoteIO for iOS, but both are unmerged with changes requested, and the iOS one has been inactive since 2024. When we built and tested them, neither handled basic capture correctly as published. Shipping them would mean maintaining our own audio drivers indefinitely, so we'd rather wait for upstream. For analysing microphone frames as they arrive, flet-audio-recorder can already stream raw PCM16 to Python. Use import flet_audio_recorder as far
import numpy as np
def on_stream(e: far.AudioRecorderStreamEvent):
samples = np.frombuffer(e.chunk, dtype=np.int16)
# analyse samples hereIt covers input only (no playback or duplex) and you can't choose the chunk size, but it works on both Android and iOS today. We'll revisit sounddevice if upstream PortAudio gains mobile support. |
Thanks for the request. We looked into this in depth, and for now we're not shipping sounddevice for mobile.
sounddevice is a thin wrapper around PortAudio, the C audio library, and upstream PortAudio has no Android or iOS backend. Two community PRs exist, Oboe for Android and RemoteIO for iOS, but both are unmerged with changes requested, and the iOS one has been inactive since 2024. When we built and tested them, neither handled basic capture correctly as published. Shipping them would mean maintaining our own audio drivers indefinitely, so we'd rather wait for upstream.
For analysing microphone frames as they arrive, flet-audio-recorder can already stream raw PCM16 to Python. Use
Audio…