@@ -122,7 +122,7 @@ static uint64_t wait_for_vad(audio_async & audio, json jparams, const whisper_pa
122
122
std::this_thread::sleep_for (milliseconds (500 - (time_now - start_time)));
123
123
time_now = time_point_cast<milliseconds>(system_clock::now ()).time_since_epoch ().count ();
124
124
} else if (time_now - start_time > 1000 ) {
125
- audio.get (time_now-start_time, pcmf32);
125
+ audio.get (( int )( time_now-start_time) , pcmf32);
126
126
size_t max_offset = pcmf32.size () - WHISPER_SAMPLE_RATE;
127
127
for (size_t offset=0 ;offset < max_offset;offset+=WHISPER_SAMPLE_RATE/10 ) {
128
128
std::vector<float > audio_chunk (&pcmf32[offset], &pcmf32[offset+WHISPER_SAMPLE_RATE]);
@@ -138,17 +138,17 @@ static uint64_t wait_for_vad(audio_async & audio, json jparams, const whisper_pa
138
138
}
139
139
}
140
140
size_t window_duration = std::max ((uint64_t )1000 , time_now-start_time);
141
- audio.get (window_duration, pcmf32);
141
+ audio.get (( int ) window_duration, pcmf32);
142
142
while (!::vad_simple (pcmf32, WHISPER_SAMPLE_RATE, 1000 , params.vad_thold , params.freq_thold , params.print_energy )) {
143
143
std::this_thread::sleep_for (milliseconds (100 ));
144
144
time_now = time_point_cast<milliseconds>(system_clock::now ()).time_since_epoch ().count ();
145
145
window_duration = std::max ((uint64_t )1000 ,time_now-start_time);
146
- audio.get (window_duration, pcmf32);
146
+ audio.get (( int ) window_duration, pcmf32);
147
147
}
148
148
if (time_now - start_time > maxlength_ms) {
149
- audio.get (maxlength_ms, pcmf32);
149
+ audio.get (( int ) maxlength_ms, pcmf32);
150
150
} else {
151
- audio.get (time_now - start_time, pcmf32);
151
+ audio.get (( int )( time_now - start_time) , pcmf32);
152
152
}
153
153
154
154
return time_now;
@@ -168,7 +168,7 @@ static json unguided_transcription(struct whisper_context * ctx, audio_async &au
168
168
prompt_tokens.resize (n);
169
169
170
170
wparams.prompt_tokens = prompt_tokens.data ();
171
- wparams.prompt_n_tokens = prompt_tokens.size ();
171
+ wparams.prompt_n_tokens = ( int ) prompt_tokens.size ();
172
172
}
173
173
wparams.print_progress = false ;
174
174
wparams.print_special = params.print_special ;
@@ -184,7 +184,7 @@ static json unguided_transcription(struct whisper_context * ctx, audio_async &au
184
184
wparams.audio_ctx = params.audio_ctx ;
185
185
wparams.suppress_nst = true ;
186
186
// run the transformer and a single decoding pass
187
- if (whisper_full (ctx, wparams, pcmf32.data (), pcmf32.size ()) != 0 ) {
187
+ if (whisper_full (ctx, wparams, pcmf32.data (), ( int ) pcmf32.size ()) != 0 ) {
188
188
fprintf (stderr, " %s: ERROR: whisper_full() failed\n " , __func__);
189
189
throw json{
190
190
{" code" , -32803 },
@@ -224,12 +224,12 @@ static json guided_transcription(struct whisper_context * ctx, audio_async &audi
224
224
// TODO: Do some time testing. Does an overly long prompt slow down processing?
225
225
// Set up command sets/precompute prompts
226
226
wparams.prompt_tokens = cs.prompt_tokens .data ();
227
- wparams.prompt_n_tokens = cs.prompt_tokens .size ();
227
+ wparams.prompt_n_tokens = ( int ) cs.prompt_tokens .size ();
228
228
// TODO: properly expose as option
229
229
wparams.suppress_nst = true ;
230
230
231
231
// run the transformer and a single decoding pass
232
- if (whisper_full (ctx, wparams, pcmf32.data (), pcmf32.size ()) != 0 ) {
232
+ if (whisper_full (ctx, wparams, pcmf32.data (), ( int ) pcmf32.size ()) != 0 ) {
233
233
fprintf (stderr, " %s: ERROR: whisper_full() failed\n " , __func__);
234
234
throw json{
235
235
{" code" , -32803 },
@@ -322,7 +322,7 @@ static json register_commandset(struct whisper_context * ctx, json jparams, std:
322
322
int n = whisper_tokenize (ctx, k_prompt.c_str (), cs.prompt_tokens .data (), 1024 );
323
323
cs.prompt_tokens .resize (n);
324
324
// prepare response
325
- int index = commandset_list.size ();
325
+ int index = ( int ) commandset_list.size ();
326
326
commandset_list.push_back (cs);
327
327
return json{{" index" ,index }};
328
328
}
0 commit comments