diff --git a/README.md b/README.md index fac1b77..c20f4ec 100644 --- a/README.md +++ b/README.md @@ -251,8 +251,6 @@ view `coverage/index.html` in a browser. 0. implement WASAPI (Windows) backend, get examples working - list devices - - raw mode - - period duration - watching - sine wave - microphone diff --git a/soundio/soundio.h b/soundio/soundio.h index dc7e9f5..c8ba5f3 100644 --- a/soundio/soundio.h +++ b/soundio/soundio.h @@ -364,9 +364,12 @@ struct SoundIoDevice { double buffer_duration_current; // Period duration in seconds. After this much time passes, write_callback - // is called. If values are unknown, they are set to 0.0. These values are - // meaningless for PulseAudio and CoreAudio. For JACK, buffer duration and - // period duration are the same. + // is called. If values are unknown, they are set to 0.0. + // For PulseAudio and CoreAudio, these values are meaningless. + // For JACK, buffer duration and period duration are the same. + // For WASAPI, `period_duration_max` is unknown for raw devices, so a + // reasonable max of 4.0 is used. You may check that the current backend is + // WASAPI and ignore the max value for raw devices. double period_duration_min; double period_duration_max; double period_duration_current; diff --git a/src/wasapi.cpp b/src/wasapi.cpp index 07c537b..21a3c10 100644 --- a/src/wasapi.cpp +++ b/src/wasapi.cpp @@ -650,7 +650,11 @@ static int refresh_devices(SoundIoPrivate *si) { return SoundIoErrorOpeningDevice; } rd.device_shared->period_duration_current = from_reference_time(default_device_period); - rd.device_shared->period_duration_min = from_reference_time(min_device_period); + rd.device_shared->period_duration_min = rd.device_shared->period_duration_current; + rd.device_shared->period_duration_max = rd.device_shared->period_duration_current; + + rd.device_raw->period_duration_min = from_reference_time(min_device_period); + rd.device_raw->period_duration_max = 4.0; if (rd.endpoint)