ASIO: add PaAsio_GetSampleRate() function#971
ASIO: add PaAsio_GetSampleRate() function#971Spacechild1 wants to merge 2 commits intoPortAudio:masterfrom
PaAsio_GetSampleRate() function#971Conversation
returns the current sample rate of the specified device at the time of library initialization. If the current sample rate is unknown, a sample rate of 0 will be returned.
|
Phil and I discussed this PR at length today. I think that an argument can be made for providing a way to query the current ASIO device sample rate irrespective of whether it's the optimal fix for #970. We already have A problem with this PR in its current form is that it does not actually query the current device sample rate. It just returns the cached value retrieved at Of course querying the current device sample rate is actually a massive pain (see |
I agree. In the PR description I actually say that I'd prefer to add a flag to |
|
@RossBencina would you consider @Spacechild1 's offer to add a flag to |
|
@RossBencina ping |
|
I'm not going to approve a patch that I havn't seen, but yes, a host-api-specific flag (i.e. a flag in the host-api-specific parameters structure) to open the stream at the current ASIO device sample rate would be a reasonable candidate for a host-API-specific extension and I can't right now think of any reason that would cause problems. If the patch is written in such a way that it is very clear that there is no change in behavior when the flag is not set, that will make it easier to make the merge decision. |
|
Thanks for the answer! Just wanted to check if you agree with the basic idea before I make a PR.
Nobody asked for that :) |
PaAsio_GetSampleRate()returns the current sample rate of the specified device at the time of library initialization.(If the current sample rate is unknown, a sample rate of 0 will be returned.)
For example, this is useful for people who want to use the current sample rate as the default sample rate (which PA's ASIO implementation does not do.)
Actually, I would rather prefer the solution proposed in #970, but if this is not desired, this PR would be an acceptable workaround.
However, the function would still be useful for other purposes, e.g. to select the "current" sample rate - instead of the "default" sample rate - in a UI dialog.