Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

fix audio session add play #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion ios/RNAudioRecord.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ @implementation RNAudioRecord

// most audio players set session category to "Playback", record won't work in this mode
// therefore set session category to "Record" before recording
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryRecord error:nil];
// use AVAudioSessionCategoryPlayAndRecord to be able to play a sound after
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];

_recordState.mIsRunning = true;
_recordState.mCurrentPacket = 0;
Expand Down