|
|
@ -135,11 +135,9 @@ void talk_main(size_t index) {
|
|
|
|
|
|
|
|
|
|
|
|
talk_set_status("processing ...");
|
|
|
|
talk_set_status("processing ...");
|
|
|
|
|
|
|
|
|
|
|
|
g_force_speak = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_last = t_now;
|
|
|
|
t_last = t_now;
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
if (!g_force_speak) {
|
|
|
|
const auto t_start = std::chrono::high_resolution_clock::now();
|
|
|
|
const auto t_start = std::chrono::high_resolution_clock::now();
|
|
|
|
|
|
|
|
|
|
|
|
int ret = whisper_full(ctx, wparams, pcmf32.data(), pcmf32.size());
|
|
|
|
int ret = whisper_full(ctx, wparams, pcmf32.data(), pcmf32.size());
|
|
|
@ -156,6 +154,7 @@ void talk_main(size_t index) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string text_heard;
|
|
|
|
std::string text_heard;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!g_force_speak) {
|
|
|
|
const int n_segments = whisper_full_n_segments(ctx);
|
|
|
|
const int n_segments = whisper_full_n_segments(ctx);
|
|
|
|
for (int i = n_segments - 1; i < n_segments; ++i) {
|
|
|
|
for (int i = n_segments - 1; i < n_segments; ++i) {
|
|
|
|
const char * text = whisper_full_get_segment_text(ctx, i);
|
|
|
|
const char * text = whisper_full_get_segment_text(ctx, i);
|
|
|
@ -167,6 +166,9 @@ void talk_main(size_t index) {
|
|
|
|
|
|
|
|
|
|
|
|
text_heard += text;
|
|
|
|
text_heard += text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_force_speak = false;
|
|
|
|
|
|
|
|
|
|
|
|
// remove text between brackets using regex
|
|
|
|
// remove text between brackets using regex
|
|
|
|
{
|
|
|
|
{
|
|
|
|