From 481e359153b01b4482f7fb655e7a600cd72c76f1 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 26 Dec 2024 04:05:53 +0200 Subject: [PATCH] janus: reduces opus frame length to 20ms --- janus/src/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/janus/src/audio.c b/janus/src/audio.c index ec33c217..0a82c11f 100644 --- a/janus/src/audio.c +++ b/janus/src/audio.c @@ -47,7 +47,8 @@ // A number of frames per 1 channel: // - https://github.com/xiph/opus/blob/7b05f44/src/opus_demo.c#L368 -#define _HZ_TO_FRAMES(_hz) (6 * (_hz) / 50) // 120ms +// #define _HZ_TO_FRAMES(_hz) (6 * (_hz) / 50) // 120ms +#define _HZ_TO_FRAMES(_hz) ((_hz) / 50) // 20ms #define _HZ_TO_BUF16(_hz) (_HZ_TO_FRAMES(_hz) * 2) // One stereo frame = (16bit L) + (16bit R) #define _HZ_TO_BUF8(_hz) (_HZ_TO_BUF16(_hz) * sizeof(s16))