Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix 88,2khz devices

Louis Beaumontfff6366d8d0b
diff --git a/screenpipe-audio/src/stt.rs b/screenpipe-audio/src/stt.rs
index ad5215913..b0faaa749 100644
--- a/screenpipe-audio/src/stt.rs
+++ b/screenpipe-audio/src/stt.rs
@@ -48,7 +48,10 @@ async fn transcribe_with_deepgram(
{
let spec = WavSpec {
channels: 1,
- sample_rate: sample_rate / 3, // for some reason 96khz device need 32 and 48khz need 16 (be mindful resampling)
+ sample_rate: match sample_rate {
+ 88200 => 16000, // Deepgram expects 16kHz for 88.2kHz
+ _ => sample_rate / 3, // Fallback for other sample rates
+ },
bits_per_sample: 32,
sample_format: hound::SampleFormat::Float,
};