whisper : free backends + fix compile warning

This commit is contained in:
Georgi Gerganov
2023-11-10 12:45:26 +02:00
parent dcf9511dbb
commit 12030358ee
2 changed files with 7 additions and 1 deletions

View File

@ -181,7 +181,7 @@ private:
// It is assumed that PCM data is normalized to a range from -1 to 1
bool write_audio(const float * data, size_t length) {
for (size_t i = 0; i < length; ++i) {
const auto intSample = static_cast<const int16_t>(data[i] * 32767);
const int16_t intSample = data[i] * 32767;
file.write(reinterpret_cast<const char *>(&intSample), sizeof(int16_t));
dataSize += sizeof(int16_t);
}