Skip to content

Commit

Permalink
Switching to Audio Channel Layout attribute
Browse files Browse the repository at this point in the history
kAudioDevicePropertyPreferredChannelLayout seems to be unavailable on iOS
  • Loading branch information
colincornaby committed Nov 9, 2024
1 parent f656f7b commit 29b03d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions alc/backends/coreaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ std::string GetDeviceName(AudioDeviceID devId)
UInt32 GetDeviceChannelCount(AudioDeviceID devId, bool isCapture)
{
UInt32 propSize{};
auto err = GetDevPropertySize(devId, kAudioDevicePropertyPreferredChannelLayout, isCapture, 0,
auto err = GetDevPropertySize(devId, kAudioUnitProperty_AudioChannelLayout, isCapture, 0,
&propSize);
if(err)
{
Expand All @@ -209,7 +209,7 @@ UInt32 GetDeviceChannelCount(AudioDeviceID devId, bool isCapture)
auto channel_data = std::make_unique<char[]>(propSize);
auto *channel_layout = reinterpret_cast<AudioChannelLayout*>(channel_data.get());

err = GetDevProperty(devId, kAudioDevicePropertyPreferredChannelLayout, isCapture, 0, propSize,
err = GetDevProperty(devId, kAudioUnitProperty_AudioChannelLayout, isCapture, 0, propSize,
channel_layout);
if(err)
{
Expand Down Expand Up @@ -609,7 +609,7 @@ bool CoreAudioPlayback::reset()

if(err == noErr)
{
err = AudioUnitGetProperty(mAudioUnit, kAudioDevicePropertyPreferredChannelLayout, kAudioUnitScope_Output, OutputElement, layout.get(), &propSize);
err = AudioUnitGetProperty(mAudioUnit, kAudioUnitProperty_AudioChannelLayout, kAudioUnitScope_Output, OutputElement, layout.get(), &propSize);

std::vector labels = std::vector<AudioChannelLayoutTag>(layout.get()->mNumberChannelDescriptions);

Expand Down

0 comments on commit 29b03d1

Please sign in to comment.