Navigation Menu

Skip to content

Commit

Permalink
Update CMCocoaSound.m
Browse files Browse the repository at this point in the history
Replace deprecated functions with their new AudioComponent versions.
  • Loading branch information
MaddTheSane committed Apr 19, 2018
1 parent 5795b3a commit b4b99c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Src/Cocoa/CMCocoaSound.m
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -200,7 +200,7 @@ - (BOOL)destroy
if (result != noErr)
success = NO;

result = CloseComponent(outputAudioUnit); // FIXME: deprec
result = AudioComponentInstanceDispose(outputAudioUnit);
if (result != noErr)
success = NO;

Expand Down

0 comments on commit b4b99c7

Please sign in to comment.