Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ios/RNSound.mm
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ - (NSString *)modeForName:(NSString *)modeName {
return modes[modeName];
}

RCT_EXPORT_METHOD(setCategory:(NSString *)categoryName mixWithOthers:(NSNumber *)mixWithOthers) {
RCT_EXPORT_METHOD(setCategory:(NSString *)categoryName mixWithOthers:(BOOL)mixWithOthers) {
AVAudioSession *session = [AVAudioSession sharedInstance];
NSString *category = [self categoryForName:categoryName];

if (category) {
if (mixWithOthers.boolValue) {
if (mixWithOthers) {
[session setCategory:category
withOptions:AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth
error:nil];
Expand Down Expand Up @@ -176,8 +176,11 @@ - (NSString *)categoryForName:(NSString *)categoryName {
}

#pragma mark - Audio Control Methods

#ifdef RCT_NEW_ARCH_ENABLED
RCT_EXPORT_METHOD(prepare:(NSString *)fileName key:(double)key options:(JS::NativeSoundIOS::SoundOptionTypes &)options callback:(RCTResponseSenderBlock)callback ) {
#else
RCT_EXPORT_METHOD(prepare:(NSString *)fileName key:(double)key options:(NSDictionary *)options callback:(RCTResponseSenderBlock)callback ) {
#endif
NSError *error;
NSURL *fileNameUrl;
AVAudioPlayer *player;
Expand Down