We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74dfd21 commit e57f3abCopy full SHA for e57f3ab
whisper.cpp/slurp.cpp
@@ -4,6 +4,7 @@
4
#include "slurp.h"
5
#include "miniaudio.h"
6
#include "llamafile/log.h"
7
+#include <math.h>
8
9
static int get_audio_file_channels(const char *fname) {
10
ma_decoder decoder;
@@ -96,7 +97,7 @@ bool slurp_audio_file(const char *fname,
96
97
for (int i = 0; i < got; ++i) {
98
float left = frames[i*2+0];
99
float right = frames[i*2+1];
- pcmf32.push_back(left + right);
100
+ pcmf32.push_back(sqrt((left*left + right*right) / 2));
101
pcmf32s[0].push_back(left);
102
pcmf32s[1].push_back(right);
103
}
0 commit comments