Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Fix audio channel mixing in new slurp code
Justine Tunneyf59f0859fbb6
diff --git a/whisper.cpp/slurp.cpp b/whisper.cpp/slurp.cppindex b40b05f9..1bac2178 100644--- a/whisper.cpp/slurp.cpp+++ b/whisper.cpp/slurp.cpp@@ -4,6 +4,7 @@#include "slurp.h"#include "miniaudio.h"#include "llamafile/log.h"+#include <math.h>static int get_audio_file_channels(const char *fname) {ma_decoder decoder;@@ -96,7 +97,7 @@ bool slurp_audio_file(const char *fname,for (int i = 0; i < got; ++i) {float left = frames[i*2+0];float right = frames[i*2+1];- pcmf32.push_back(left + right);+ pcmf32.push_back(sqrtf((left*left + right*right) / 2));pcmf32s[0].push_back(left);pcmf32s[1].push_back(right);}