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

scsynth: CoreAudio: don't complain about mismatched sample rates if numInputBusChannels == 0 #2610

Merged
merged 2 commits into from
Jan 2, 2017

Conversation

nhthn
Copy link
Contributor

@nhthn nhthn commented Jan 2, 2017

Fix for #2608. The scsynth CoreAudio driver checks to make sure that the sample rates of the input and output devices are the same, and if they are not, an error message is produced and scsynth refuses to boot. This commit skips the check if the number of input bus channels is 0. This allows the command-line option "-i 0" to serve as a simple workaround if the user would prefer to simply ignore the input device.

The driver still queries some information about the input device, so this is sort of a bandage. Also, I'm committing blind, so please test.

Nathan Ho added 2 commits January 1, 2017 16:20
The scsynth CoreAudio driver checks to make sure that the sample rates of the input and output devices are the same, and if they are not, an error message is produced and scsynth refuses to boot. This commit skips the check if the number of input bus channels is 0. This allows the command-line option "-i 0" to serve as a simple workaround if the user would prefer to simply ignore the input device.
inputStreamDesc.mSampleRate != outputStreamDesc.mSampleRate
) {
scprintf(
"ERROR: Input sample rate is %g, but output is %g. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe s/output/output rate/ for clarity?

) {
scprintf(
"ERROR: Input sample rate is %g, but output is %g. "
"Mismatched sample rates are not supported. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's SC's style regarding adjacent strings for concatenation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen it in other places in our codebase, but I'm too lazy to check where.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ will concatenate these just fine. SC does the same thing, no added spaces.

@vivid-synth
Copy link
Member

Other than my little stylistic questions, looks good to me (although I'm another person who can't test -- just go off @samaaron 's word that it works correctly)

@vivid-synth vivid-synth merged commit 996e3c9 into supercollider:master Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants