srctree

Robin Linden parent f5cfb52e 7cf99d2a
Release audio captures after using them

inlinesplit
domain/src/main/kotlin/av/AudioCapture.kt added: 4, removed: 2, total 2
@@ -39,6 +39,7 @@ class AudioCapture(private val sampleRate: Int, private val channels: Int) {
fun isOk() = audioRecord != null
fun start() = audioRecord?.startRecording()
fun stop() = audioRecord?.stop()
fun release() = audioRecord?.release()
fun read(): ShortArray {
val bytes = ShortArray((sampleRate * channels * 0.1).toInt()) // E.g. 16-bit, 48kHz, 1 channel, 100ms
audioRecord?.read(bytes, 0, bytes.size)
 
domain/src/main/kotlin/feature/CallManager.kt added: 4, removed: 2, total 2
@@ -48,6 +48,7 @@ class CallManager @Inject constructor(
}
}
recorder.stop()
recorder.release()
}
return true
}