@@ -10,13 +10,13 @@ using json = nlohmann::json;
10
10
struct whisper_print_user_data {
11
11
const whisper_params *params;
12
12
13
- const std::vector <std::vector<float >> *pcmf32s;
13
+ const std::vector<std::vector<float >> *pcmf32s;
14
14
int progress_prev;
15
15
};
16
16
17
17
// Terminal color map. 10 colors grouped in ranges [0.0, 0.1, ..., 0.9]
18
18
// Lowest is red, middle is yellow, highest is green.
19
- const std::vector <std::string> k_colors = {
19
+ const std::vector<std::string> k_colors = {
20
20
" \033 [38;5;196m" , " \033 [38;5;202m" , " \033 [38;5;208m" , " \033 [38;5;214m" , " \033 [38;5;220m" ,
21
21
" \033 [38;5;226m" , " \033 [38;5;190m" , " \033 [38;5;154m" , " \033 [38;5;118m" , " \033 [38;5;82m" ,
22
22
};
@@ -27,7 +27,7 @@ int timestamp_to_sample(int64_t t, int n_samples) {
27
27
}
28
28
29
29
std::string
30
- estimate_diarization_speaker (std::vector <std::vector<float >> pcmf32s, int64_t t0, int64_t t1, bool id_only = false ) {
30
+ estimate_diarization_speaker (std::vector<std::vector<float >> pcmf32s, int64_t t0, int64_t t1, bool id_only = false ) {
31
31
std::string speaker = " " ;
32
32
const int64_t n_samples = pcmf32s[0 ].size ();
33
33
@@ -132,7 +132,7 @@ void whisper_print_segment_callback(struct whisper_context *ctx, struct whisper_
132
132
}
133
133
134
134
std::string
135
- output_str (struct whisper_context *ctx, const whisper_params ¶ms, std::vector <std::vector<float >> pcmf32s) {
135
+ output_str (struct whisper_context *ctx, const whisper_params ¶ms, std::vector<std::vector<float >> pcmf32s) {
136
136
std::stringstream result;
137
137
const int n_segments = whisper_full_n_segments (ctx);
138
138
for (int i = 0 ; i < n_segments; ++i) {
@@ -199,7 +199,7 @@ void getReqParameters(const Request &req, whisper_params ¶ms) {
199
199
}
200
200
201
201
bool read_audio_file (std::string audio_format, std::string filename, std::vector<float > &pcmf32,
202
- std::vector <std::vector<float >> &pcmf32s, bool diarize) {
202
+ std::vector<std::vector<float >> &pcmf32s, bool diarize) {
203
203
204
204
// read audio content into pcmf32
205
205
if (audio_format == " mp3" ) {
@@ -222,7 +222,7 @@ bool read_audio_file(std::string audio_format, std::string filename, std::vector
222
222
}
223
223
224
224
bool run (std::mutex &whisper_mutex, whisper_params ¶ms, whisper_context *ctx, std::string filename,
225
- const std::vector <std::vector<float >> &pcmf32s, std::vector<float > pcmf32) {
225
+ const std::vector<std::vector<float >> &pcmf32s, std::vector<float > pcmf32) {
226
226
// print system information
227
227
{
228
228
fprintf (stderr, " \n " );
@@ -372,7 +372,7 @@ void handleInference(const Request &request, Response &response, std::mutex &whi
372
372
373
373
// audio arrays
374
374
std::vector<float > pcmf32; // mono-channel F32 PCM
375
- std::vector <std::vector<float >> pcmf32s; // stereo-channel F32 PCM
375
+ std::vector<std::vector<float >> pcmf32s; // stereo-channel F32 PCM
376
376
377
377
// write file to temporary file
378
378
std::ofstream temp_file{filename, std::ios::binary};
0 commit comments