Skip to content

Commit

Permalink
Replicate change of PR #168 into startRecorder (#183)
Browse files Browse the repository at this point in the history
PR #168 fixed the possibility to add a custom path on iOS, but only for startPlayer, the same code is in startRecorder, so I replicated the change in that method also.
  • Loading branch information
escobar5 authored Apr 18, 2020
1 parent f798435 commit 26921ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ios/RNAudioRecorderPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,13 @@ - (dispatch_queue_t)methodQueue
NSNumber *audioQuality = [RCTConvert NSNumber:audioSets[@"AVEncoderAudioQualityKeyIOS"]];

if ([path isEqualToString:@"DEFAULT"]) {
audioFileURL = [NSURL fileURLWithPath:[GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:@"sound.m4a"]];
audioFileURL = [NSURL fileURLWithPath:[GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:@"sound.m4a"]];
} else {
audioFileURL = [NSURL fileURLWithPath: [GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:path]];
if ([path rangeOfString:@"file://"].location == NSNotFound) {
audioFileURL = [NSURL fileURLWithPath: [GetDirectoryOfType_Sound(NSCachesDirectory) stringByAppendingString:path]];
} else {
audioFileURL = [NSURL URLWithString:path];
}
}

if (!sampleRate) {
Expand Down

0 comments on commit 26921ec

Please sign in to comment.