Skip to content

Commit

Permalink
fix for avenginesoundplayer multiplay - closes #7931 (#7945)
Browse files Browse the repository at this point in the history
#changelog #avengine
  • Loading branch information
ofTheo committed May 10, 2024
1 parent 5c4cac7 commit 07590eb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm
Expand Up @@ -593,7 +593,7 @@ - (BOOL)loadWithURL:(NSURL*)url {
self.soundFile = nil;
return NO;
}else{
NSLog(@"Sound file %@ loaded!", url);
//NSLog(@"Sound file %@ loaded!", url);
}

return [self loadWithSoundFile:self.soundFile];
Expand All @@ -614,7 +614,7 @@ - (void)startEngine{
problem = YES;

} else {
NSLog(@"Engine start successful");
//NSLog(@"Engine start successful");
if(self.resetAudioEngine) {
// [self engineReset];
if(self.resetAudioEngine == NO)
Expand Down Expand Up @@ -847,11 +847,13 @@ - (void)pause {
}

- (void)stop {

__typeof(self) __weak weak_self = self;
if (!_bIsPlaying) {
return;
}

if(_isSessionInterrupted || _isConfigChangePending){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3f), dispatch_get_main_queue(), ^{
__typeof(self) __weak weak_self = self;
[weak_self stop];
});
return;
Expand All @@ -868,6 +870,7 @@ - (void)stop {
self.startedSampleOffset = 0;
}


//----------------------------------------------------------- states.
- (BOOL)isLoaded {
return (self.soundPlayer != nil);
Expand Down

0 comments on commit 07590eb

Please sign in to comment.