in STTMetrics, difference between duration and aud...
# ask-ai
k
in STTMetrics, difference between duration and audio_duration?
g
It seems likely that in
STTMetrics
,
duration
refers to the total time taken for the speech-to-text (STT) process to complete, including any processing or waiting time. In contrast,
audio_duration
specifically measures the length of the audio that was processed. This distinction is important for understanding the efficiency and performance of the STT process. Would you like more detail on how these metrics are used or calculated? Sources: - https://docs.livekit.io/python/livekit/agents/stt/stt.html#livekit.agents.stt.stt.SpeechStream - https://docs.livekit.io/python/livekit/agents/metrics/base.html#livekit.agents.metrics.base.PipelineTTSMetrics 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
k
@millions-hair-24956 if i want to calculate my STT service cost directly from STTMetrics, should i use duration or audio_duration?
g
To calculate the cost of your STT service, you should use
audio_duration
. This metric represents the actual length of the audio processed, which is typically what STT services charge for, rather than the total processing time (
duration
). Would you like more information on how to implement this calculation? Sources: - https://docs.livekit.io/python/livekit/agents/metrics/index.html#livekit.agents.metrics.STTMetrics 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
k
@millions-hair-24956 are these metrics total across the whole call?
g
The metrics in
STTMetrics
, such as
audio_duration
, are typically reported for individual events or segments within a session, rather than aggregated across the entire call. To obtain total metrics for the entire call, you would need to aggregate these individual metrics over the session. Would you like more details on how to aggregate these metrics? Sources: - https://docs.livekit.io/agents/build/metrics/ 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
k
@millions-hair-24956 is summing audio_duration the same as the total call time
g
Summing
audio_duration
is not necessarily the same as the total call time.
audio_duration
represents the length of audio processed by the STT service, which may not account for periods of silence or other non-audio activities during the call. The total call time would include these silent periods and any other interactions that do not involve audio processing. Would you like more information on how to calculate the total call time? Sources: - https://docs.livekit.io/agents/build/metrics/ 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.