iosmacosbluetoothsimpleaudioengine

Objective-C: SimpleAudioEngine's playEffect does not work via bluetooth speaker


SimpleAudioEngine's playEffect does not work on bluetooth player.

However playBackgroundMusic does work on bluetooth speaker.

Both playBackgroundMusic and playEffect work on iPad on it's own but when it comes to playing it via bluetooth speaker, only playBackgroundMusic works and effects (played with playEffect) are not heard.

Here's some relevant code:

#import <Foundation/Foundation.h>
#import "SimpleAudioEngine.h"

@interface MyAudioEngine : NSObject
{
    //NSInteger* currentEffect;
    NSMutableArray* effectsInPlay;
}

+(MyAudioEngine*) singleton;

-(void) playEffect:(NSString*) fileName;
-(void) stopPlayingCurrentEffect;

@end

Solution

  • Fixed with the OALSimpleAudio class in Cocos 3.0 which replaces SimpleAudio.