Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I get the device info from ASIO controlpanel by C#? #1185

Open
hlz2516 opened this issue Sep 20, 2024 · 0 comments
Open

Can I get the device info from ASIO controlpanel by C#? #1185

hlz2516 opened this issue Sep 20, 2024 · 0 comments

Comments

@hlz2516
Copy link

hlz2516 commented Sep 20, 2024

In the process of researching simultaneous recording and playback, I found that in my C # code, the input and output sampling rates are manually written(like this):

            var drivers = AsioOut.GetDriverNames();
            var asioOut = new AsioOut(drivers[0]);
            var bufferedWaveProvider = new BufferedWaveProvider(new WaveFormat(48000, 4));
            asioOut.InitRecordAndPlayback(bufferedWaveProvider, 2, 48000);
            asioOut.AudioAvailable += AsioOut_AudioAvailable;

I think they should be the same as the sample rate of the input and output device currently being used instead of being manually written, but I don't know how to do it.
After calling ShowControlPanel(), moving the mouse over an audio device in the control panel will display the corresponding sample rate, as shown in the figure:
Snipaste_2024-09-21_02-10-21
I want to get the sample rate of the currently used device in this control panel, but I found that NAudio doesn't seem to have a corresponding API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant