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

Added command line option to select audio output device. #38

Merged
merged 3 commits into from
Apr 12, 2024
Merged

Added command line option to select audio output device. #38

merged 3 commits into from
Apr 12, 2024

Conversation

Falcosoft
Copy link
Contributor

Use -a:<audio_device_index> command line argument to specify audio output device.

… as Midi port)

Use -a:<audio_device_index> command line argument to specify audio output device..
src/mcu.cpp Outdated
@@ -1064,12 +1064,16 @@ int MCU_OpenAudio(void)
spec.channels = 2;
spec.callback = audio_callback;
spec.samples = audio_page_size / 4;

const char* audioDevicename = SDL_GetAudioDeviceName(deviceIndex, 0);
Copy link
Owner

Choose a reason for hiding this comment

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

maybe add range check for deviceIndex? (against what SDL_GetNumAudioDevices() returns)

Copy link
Contributor Author

@Falcosoft Falcosoft Apr 12, 2024

Choose a reason for hiding this comment

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

OK, I have added error checking and fixed default device selection logic ( 0 does not mean default, but always denotes 1st device).

@nukeykt nukeykt merged commit 4b2b06d into nukeykt:master Apr 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants