Skip to content

Commit dad7782

Browse files
authored
Merge pull request #2081 from lcintron/fix/audio-source-sleeptime-mismatch
fix: addresses slow frame emission due to time unit mismatch
2 parents c6ad854 + eda4d28 commit dad7782

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

encoder/src/main/java/com/pedro/encoder/input/sources/audio/SilenceAudioSource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SilenceAudioSource: AudioSource(), GetMicrophoneData {
4242

4343
override fun create(sampleRate: Int, isStereo: Boolean, echoCanceler: Boolean, noiseSuppressor: Boolean): Boolean {
4444
val channels = if (isStereo) 2 else 1
45-
sleepTime = ((buffer.size.toDouble() / (sampleRate * channels * 2L)) * 1000000L).toLong()
45+
sleepTime = ((buffer.size.toDouble() / (sampleRate * channels * 2L)) * 1000L).toLong()
4646
return true
4747
}
4848

0 commit comments

Comments
 (0)