Add some comment
This commit is contained in:
parent
83c695d695
commit
c10c60134c
4 changed files with 13 additions and 3 deletions
|
|
@ -63,6 +63,8 @@ class DefaultVoiceRecorder(
|
|||
private var outputFile: File? = null
|
||||
private var audioReader: AudioReader? = null
|
||||
private var recordingJob: Job? = null
|
||||
|
||||
// List of Float between 0 and 1 representing the audio levels
|
||||
private val levels: MutableList<Float> = mutableListOf()
|
||||
private val lock = Mutex()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
package io.element.android.libraries.voicerecorder.impl.audio
|
||||
|
||||
import androidx.annotation.FloatRange
|
||||
|
||||
interface AudioLevelCalculator {
|
||||
/**
|
||||
* Calculate the audio level of the audio buffer.
|
||||
|
|
@ -14,5 +16,6 @@ interface AudioLevelCalculator {
|
|||
* @param buffer The audio buffer containing 16bit PCM audio data.
|
||||
* @return A float value between 0 and 1 proportional to the audio level.
|
||||
*/
|
||||
@FloatRange(from = 0.0, to = 1.0)
|
||||
fun calculateAudioLevel(buffer: ShortArray): Float
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue