Skip to content

Commit

Permalink
Implemented SetVolume for macOSX.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainYS authored and CaptainYS committed Dec 5, 2023
1 parent 5733015 commit e07f931
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/yssimplesound/src/macosx/yssimplesound_macosx_objc.m
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,19 @@ void YsSimpleSound_OSX_SetVolume(struct YsAVAudioEngine *engineInfoPtr,struct Ys
{
if(nil!=ptr)
{
#if !__has_feature(objc_arc)
AVAudioEngine *enginePtr=engineInfoPtr->enginePtr;
AVAudioMixerNode *mixerNodePtr=engineInfoPtr->mixerNodePtr;
AVAudioPlayerNode *playerNodePtr=ptr->playerNodePtr;
AVAudioPCMBuffer *PCMBufferPtr=ptr->PCMBufferPtr;
#else
AVAudioEngine *enginePtr=(__bridge AVAudioEngine *)engineInfoPtr->enginePtr;
AVAudioMixerNode *mixerNodePtr=(__bridge AVAudioMixerNode *)engineInfoPtr->mixerNodePtr;
AVAudioPlayerNode *playerNodePtr=(__bridge AVAudioPlayerNode *)ptr->playerNodePtr;
AVAudioPCMBuffer *PCMBufferPtr=(__bridge AVAudioPCMBuffer *)ptr->PCMBufferPtr;
#endif

playerNodePtr.volume=vol;
}
}

Expand Down

0 comments on commit e07f931

Please # to comment.