guard encoder / decoder .stop
This commit is contained in:
+10
-2
@@ -196,7 +196,11 @@ class VoiceAnonymizer {
|
|||||||
|
|
||||||
return DecodedAudio(pcmSamples.toFloatArray(), sampleRate, duration)
|
return DecodedAudio(pcmSamples.toFloatArray(), sampleRate, duration)
|
||||||
} finally {
|
} finally {
|
||||||
decoder?.stop()
|
try {
|
||||||
|
decoder?.stop()
|
||||||
|
} catch (_: IllegalStateException) {
|
||||||
|
// Decoder was never started
|
||||||
|
}
|
||||||
decoder?.release()
|
decoder?.release()
|
||||||
extractor.release()
|
extractor.release()
|
||||||
}
|
}
|
||||||
@@ -400,7 +404,11 @@ class VoiceAnonymizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
encoder.stop()
|
try {
|
||||||
|
encoder.stop()
|
||||||
|
} catch (_: IllegalStateException) {
|
||||||
|
// Encoder was never started
|
||||||
|
}
|
||||||
encoder.release()
|
encoder.release()
|
||||||
if (muxerStarted) {
|
if (muxerStarted) {
|
||||||
muxer.stop()
|
muxer.stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user