mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
fix: Fallback to 0 amplitude on error; Closes #14
This commit is contained in:
parent
8bd9e3d35a
commit
d87c7a182e
@ -73,5 +73,11 @@ class AudioRecorderService: IntervalRecorderService() {
|
|||||||
|
|
||||||
override fun getAmplitudeAmount(): Int = amplitudesAmount
|
override fun getAmplitudeAmount(): Int = amplitudesAmount
|
||||||
|
|
||||||
override fun getAmplitude(): Int = recorder?.maxAmplitude ?: 0
|
override fun getAmplitude(): Int {
|
||||||
|
return try {
|
||||||
|
recorder!!.maxAmplitude
|
||||||
|
} catch (error: IllegalStateException) {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user