audiodev.web_audio
Browser Web Audio backend for PyScript (audiodev PCM devices).
- class audiodev.web_audio.WebPCMOutput(fmt, *, poll_ms=4)[source]
Bases:
PCMOutputQueued PCM playback via AudioContext + AudioBufferSourceNode.
- class audiodev.web_audio.WebPCMInput(fmt, *, poll_ms=4, queue_ms=500, samples=2048)[source]
Bases:
PCMInputMicrophone capture via getUserMedia + ScriptProcessorNode.
- audiodev.web_audio.pcm_out(format=None, *, latency=None, poll_ms=4)[source]
Create a Web Audio-backed
PCMOutput(PyScript).latencyis accepted for portability and validated, but every profile behaves the same here: playback schedules each buffer onto theAudioContexttimeline as it arrives, so there is no queue or coalescing window to shorten. Web Audio is already at the “low” profile.
- audiodev.web_audio.pcm_in(format=None, *, latency=None, poll_ms=4, queue_ms=500, samples=None)[source]
Create a Web Audio-backed
PCMInputvia getUserMedia (PyScript).samplesis theScriptProcessorNodeblock size, which the browser rounds to a power of two. The"low"profile asks for a smaller block.