File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
android-wave-recorder/src/main/java/com/github/squti/androidwaverecorder Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ class WaveRecorder {
389
389
* Calling this method while still recording throws an IllegalStateException
390
390
*/
391
391
fun changeFilePath (newFilePath : String ) {
392
- if (audioRecorder.recordingState == AudioRecord .RECORDSTATE_RECORDING )
392
+ if (isAudioRecorderInitialized() && audioRecorder.recordingState == AudioRecord .RECORDSTATE_RECORDING )
393
393
throw IllegalStateException (" Cannot change filePath when still recording." )
394
394
else
395
395
filePath = newFilePath
@@ -399,7 +399,7 @@ class WaveRecorder {
399
399
* Calling this method while still recording throws an IllegalStateException
400
400
*/
401
401
fun changeFilePath (newFileUri : Uri ) {
402
- if (audioRecorder.recordingState == AudioRecord .RECORDSTATE_RECORDING )
402
+ if (isAudioRecorderInitialized() && audioRecorder.recordingState == AudioRecord .RECORDSTATE_RECORDING )
403
403
throw IllegalStateException (" Cannot change filePath when still recording." )
404
404
else
405
405
fileUri = newFileUri
You can’t perform that action at this time.
0 commit comments