common : fix wav buffer detection (#1819)

This commit is contained in:
JacobLinCool
2024-01-31 01:35:08 +08:00
committed by GitHub
parent baa30bacdb
commit ae5c4f7340
2 changed files with 19 additions and 1 deletions

View File

@ -135,6 +135,9 @@ gpt_vocab::id gpt_sample_top_k_top_p_repeat(
// Audio utils
//
// Check if a buffer is a WAV audio file
bool is_wav_buffer(const std::string buf);
// Read WAV audio file and store the PCM data into pcmf32
// fname can be a buffer of WAV data instead of a filename
// The sample rate of the audio must be equal to COMMON_SAMPLE_RATE