Permalink
Browse files

Update CMCocoaSound.m

Replace deprecated functions with their new AudioComponent versions.
  • Loading branch information...
MaddTheSane committed Apr 19, 2018
1 parent 5795b3a commit b4b99c79b5a67633fed81a309b3c0da325fd921e
Showing with 5 additions and 5 deletions.
  1. +5 −5 Src/Cocoa/CMCocoaSound.m
@@ -81,8 +81,8 @@ - (BOOL)initializeWithSampleRate:(UInt32)sampleRate
bitsPerChannel:(UInt16)bitsPerChannel
{
OSStatus result = noErr;
Component comp;
ComponentDescription desc;
AudioComponent comp;
AudioComponentDescription desc;
struct AURenderCallbackStruct callback;
AudioStreamBasicDescription requestedDesc;
@@ -106,12 +106,12 @@ - (BOOL)initializeWithSampleRate:(UInt32)sampleRate
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
comp = FindNextComponent(NULL, &desc); // FIXME: deprec
comp = AudioComponentFindNext(NULL, &desc);
if (!comp)
return NO;
// Open & initialize the default output audio unit
result = OpenAComponent(comp, &outputAudioUnit); // FIXME: deprec
result = AudioComponentInstanceNew(comp, &outputAudioUnit);
if (result != noErr)
return NO;
@@ -200,7 +200,7 @@ - (BOOL)destroy
if (result != noErr)
success = NO;
result = CloseComponent(outputAudioUnit); // FIXME: deprec
result = AudioComponentInstanceDispose(outputAudioUnit);
if (result != noErr)
success = NO;

0 comments on commit b4b99c7

Please sign in to comment.