mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-22 22:35:28 +00:00
WASAPI: get period duration for raw devices
This commit is contained in:
parent
9a06d22608
commit
e82c3e89da
|
@ -251,8 +251,6 @@ view `coverage/index.html` in a browser.
|
||||||
|
|
||||||
0. implement WASAPI (Windows) backend, get examples working
|
0. implement WASAPI (Windows) backend, get examples working
|
||||||
- list devices
|
- list devices
|
||||||
- raw mode
|
|
||||||
- period duration
|
|
||||||
- watching
|
- watching
|
||||||
- sine wave
|
- sine wave
|
||||||
- microphone
|
- microphone
|
||||||
|
|
|
@ -364,9 +364,12 @@ struct SoundIoDevice {
|
||||||
double buffer_duration_current;
|
double buffer_duration_current;
|
||||||
|
|
||||||
// Period duration in seconds. After this much time passes, write_callback
|
// 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
|
// is called. If values are unknown, they are set to 0.0.
|
||||||
// meaningless for PulseAudio and CoreAudio. For JACK, buffer duration and
|
// For PulseAudio and CoreAudio, these values are meaningless.
|
||||||
// period duration are the same.
|
// 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_min;
|
||||||
double period_duration_max;
|
double period_duration_max;
|
||||||
double period_duration_current;
|
double period_duration_current;
|
||||||
|
|
|
@ -650,7 +650,11 @@ static int refresh_devices(SoundIoPrivate *si) {
|
||||||
return SoundIoErrorOpeningDevice;
|
return SoundIoErrorOpeningDevice;
|
||||||
}
|
}
|
||||||
rd.device_shared->period_duration_current = from_reference_time(default_device_period);
|
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)
|
if (rd.endpoint)
|
||||||
|
|
Loading…
Reference in a new issue