I call whisper_call, once the vector size I sent surpass 22400, the program crash. Why? I cannot make it through #977
Unanswered
LeeKevinXO
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
whisper_full_params wparams = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
wparams.print_progress = false;
wparams.print_special = params.print_special;
wparams.print_realtime = false;
wparams.print_timestamps = !params.no_timestamps;
wparams.translate = params.translate;
wparams.single_segment = false;
wparams.max_tokens = params.max_tokens;
wparams.language = lang.c_str();
wparams.n_threads = params.n_threads;
wparams.audio_ctx = params.audio_ctx;
wparams.speed_up = params.speed_up;
// disable temperature fallback
//wparams.temperature_inc = -1.0f;
wparams.temperature_inc = params.no_fallback ? 0.0f : wparams.temperature_inc;
wparams.prompt_tokens = params.no_context ? nullptr : tokens.data();
wparams.prompt_n_tokens = params.no_context ? 0 : tokens.size();
whisper_full(whisperContext, wparams, whisperSendData.data(), whisperSendData.size());
whisperSendData is the audio data that collected from winmm api of windows.
I wrote down the audio data and it is all right.
But the audio data from winmm api is 16 bits so I converted it to 32float as below
for (size_t i = 0; i < size; i++)
{
int16_t sample = static_cast<int16_t>((pBuffer[i * 2] & 0xFF) | (pBuffer[i * 2 + 1] << 8));
queue->push_back(static_cast(sample) / 32767.0f);
}
sample rate = 16000
soundtrack = 1
Once whisperSendData.data() > 22400, call whisper_full will crash.
I am stuck at this point several days, can't make it through.
What possible reasons for the crashing?
whisperSendData is a std::vector.
Beta Was this translation helpful? Give feedback.
All reactions