Skip to content

Commit

Permalink
Only use WAVE surround sound channel layouts on macOS 10.15+
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 14, 2025
1 parent 45492c3 commit 65ade94
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/audio/coreaudio/SDL_coreaudio.m
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,26 @@ static bool PrepareAudioQueue(SDL_AudioDevice *device)
layout.mChannelLayoutTag = kAudioChannelLayoutTag_DVD_12;
break;
case 7:
// L R C LFE Cs Ls Rs
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_6_1;
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
// L R C LFE Cs Ls Rs
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_6_1;
} else {
// FIXME: We need to manually swizzle channels into a supported layout
// L R C LFE Ls Rs Cs
//layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A;
return SDL_SetError("Unsupported audio channels");
}
break;
case 8:
// L R C LFE Rls Rrs Ls Rs
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_7_1;
if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) {
// L R C LFE Rls Rrs Ls Rs
layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_7_1;
} else {
// FIXME: We need to manually swizzle channels into a supported layout
// L R C LFE Ls Rs Rls Rrs
//layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_C;
return SDL_SetError("Unsupported audio channels");
}
break;
default:
return SDL_SetError("Unsupported audio channels");
Expand Down

0 comments on commit 65ade94

Please sign in to comment.