Skip to content

Commit

Permalink
Refactor whisper-processing.cpp to update duration_ms in run_whisper_…
Browse files Browse the repository at this point in the history
…inference
  • Loading branch information
royshil committed May 20, 2024
1 parent 69586b0 commit d3764f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/whisper-utils/whisper-processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ int run_whisper_inference(struct cleanstream_data *gf, const float *pcm32f_data,
// run the inference
int whisper_full_result = -1;
try {
gf->whisper_params.duration_ms =
(int)((float)pcm32f_size / WHISPER_SAMPLE_RATE * 1000.0f);
whisper_full_result = whisper_full(gf->whisper_context, gf->whisper_params,
pcm32f_data, (int)pcm32f_size);
} catch (const std::exception &e) {
Expand Down

0 comments on commit d3764f5

Please sign in to comment.