cpal icon indicating copy to clipboard operation
cpal copied to clipboard

No devices on default host on WASM32, specifically Chromium

Open JohnDowson opened this issue 2 years ago • 1 comments

I'm attempting to use cpal for a browser build of my sound synthesizer, but encountering an issue where cpal::default_host has no output devices - host.devices() iterator is empty. host.id() returns "WebAudio".

I want to note that I am trying to enumerate devices from a web worker used to emulate threads.

cpal 15.2 Chromium Version 118.0.5993.117 (Official Build) Arch Linux (64-bit)

Edit: still posting this for google-ability, but the issue is the web-worker. Moving to the main worker brings devices back, but results in issue #656 surfacing.

JohnDowson avatar Nov 24 '23 21:11 JohnDowson

The workaround in #774 leads to another issue: waiting on a channel is not possible in the main worker, and so there isn't really a way to receive samples.

JohnDowson avatar Nov 25 '23 13:11 JohnDowson