1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2025 Mathieu Duponchelle <mathieu@centricular.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// <https://mozilla.org/MPL/2.0/>.
//
// SPDX-License-Identifier: MPL-2.0
/**
* SECTION:element-textaccumulate
*
* `textaccumulate` is an element that can be used to accumulate text prior to
* translation or synthesis.
*
* When working with live data, the element will accumulate input text until
* the deadline is reached, comparing the current running time with the running
* time of the input items and the upstream latency.
*
* At this point the input items will be drained up until a configurable pattern
* is encountered, see the #GstTextAccumulate:timeout-terminators for more information.
*
* If the pattern does not match, the entire accumulator is drained.
*
* The accumulator will also be drained upon receiving `rstranscribe/final-transcript`
* and `rstranscribe/speaker-change` custom events.
*
* When the user wants to use a very low / no latency upstream, and is willing to
* accept desynchronization in order to build up long-enough sentences for translation,
* they can set the #GstTextAccumulate:lateness property to shift the input
* timestamps forward when accumulating.
*/
use glib;
use *;
use LazyLock;
static CAT: = new;
wrapper!