We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d70755 commit 305cc63Copy full SHA for 305cc63
examples/stream.wasm/emscripten.cpp
@@ -103,11 +103,11 @@ void stream_main(size_t index) {
103
104
{
105
const int n_segments = whisper_full_n_segments(ctx);
106
- for (int i = n_segments - 1; i < n_segments; ++i) {
107
- const char * text = whisper_full_get_segment_text(ctx, i);
+ if (n_segments > 0) {
+ const char * text = whisper_full_get_segment_text(ctx, n_segments - 1);
108
109
- const int64_t t0 = whisper_full_get_segment_t0(ctx, i);
110
- const int64_t t1 = whisper_full_get_segment_t1(ctx, i);
+ const int64_t t0 = whisper_full_get_segment_t0(ctx, n_segments - 1);
+ const int64_t t1 = whisper_full_get_segment_t1(ctx, n_segments - 1);
111
112
printf("transcribed: %s\n", text);
113
0 commit comments