You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for IAudioClient3::InitializeSharedAudioStream() #68
Thanks for the suggestion. This looks like a reasonable addition and it doesn't conflict with anything in the crate, so I'm happy to have it. I will queue it for the next release, but I can't say when I will get to it.
If you want to try it, a PR is welcome. It should follow the convention in the crate and add a new initialize method, like the application capture support has its own method, not a new StreamMode variant. The engine period functions work in frames while the rest of the API uses 100 ns units, so that needs some care. The new method also needs to set the same internal state that initialize_client sets, and it needs a check of which stream flags are allowed with this call. The device tests run on VB-Cable, which may not allow periods below the default, so a test might only be able to check that the returned values are consistent.
About the device format mentioned in the cpal discussion. As far as I can tell from the docs, the format passed to this call must be one that the shared mode engine supports, so it does not work like exclusive mode where the device takes any format it supports. Asking the engine to switch format is done with StreamOption::MatchFormat via SetClientProperties, and that is already available in the crate. So I think the main new thing here is the shorter period. Do you know of anything more about the format behavior that we might have missed? If you have tested it, I would like to hear what you saw.
it does not work like exclusive mode where the device takes any format it supports
Oops yeah now that I think about it, changing the engine format still means that all other existing streams need to be converted, so obviously the format needs to be supported by the converter 😅 nvm that part then
Asking the engine to switch format is done with StreamOption::MatchFormat via SetClientProperties
Oh interesting, I didn't know this yet
I guess it is really just for the period size then
Activity
HEnquist commentedon Oct 4, 2026
Thanks for the suggestion. This looks like a reasonable addition and it doesn't conflict with anything in the crate, so I'm happy to have it. I will queue it for the next release, but I can't say when I will get to it.
If you want to try it, a PR is welcome. It should follow the convention in the crate and add a new initialize method, like the application capture support has its own method, not a new StreamMode variant. The engine period functions work in frames while the rest of the API uses 100 ns units, so that needs some care. The new method also needs to set the same internal state that initialize_client sets, and it needs a check of which stream flags are allowed with this call. The device tests run on VB-Cable, which may not allow periods below the default, so a test might only be able to check that the returned values are consistent.
About the device format mentioned in the cpal discussion. As far as I can tell from the docs, the format passed to this call must be one that the shared mode engine supports, so it does not work like exclusive mode where the device takes any format it supports. Asking the engine to switch format is done with StreamOption::MatchFormat via SetClientProperties, and that is already available in the crate. So I think the main new thing here is the shorter period. Do you know of anything more about the format behavior that we might have missed? If you have tested it, I would like to hear what you saw.
LastExceed commentedon Oct 4, 2026
Yes, I plan to do this
Oops yeah now that I think about it, changing the engine format still means that all other existing streams need to be converted, so obviously the format needs to be supported by the converter 😅 nvm that part then
Oh interesting, I didn't know this yet
I guess it is really just for the period size then