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

rename `converge_to_mono` to `stereo_to_mono`

Ezra Ellette510650c84d7d
diff --git a/screenpipe-audio/src/audio_processing.rs b/screenpipe-audio/src/audio_processing.rs
index cdb417547..52f2bfdee 100644
--- a/screenpipe-audio/src/audio_processing.rs
+++ b/screenpipe-audio/src/audio_processing.rs
@@ -79,7 +79,7 @@ pub fn average_noise_spectrum(audio: &[f32]) -> f32 {
total_sum / audio.len() as f32
}
-pub fn converge_to_mono(audio: &[f32], channels: u16) -> Vec<f32> {
+pub fn stereo_to_mono(audio: &[f32], channels: u16) -> Vec<f32> {
let mut mono = audio.to_vec();
if channels > 1 {
diff --git a/screenpipe-audio/src/core.rs b/screenpipe-audio/src/core.rs
index 9e233a6a2..16b7c5eea 100644
--- a/screenpipe-audio/src/core.rs
+++ b/screenpipe-audio/src/core.rs
@@ -1,4 +1,4 @@
-use crate::audio_processing::converge_to_mono;
+use crate::audio_processing::stereo_to_mono;
use crate::AudioInput;
use anyhow::{anyhow, Result};
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
@@ -203,7 +203,7 @@ pub async fn record_and_transcribe(
.upgrade()
.map_or(false, |arc| arc.load(Ordering::Relaxed))
{
- let mono = converge_to_mono(bytemuck::cast_slice(data), channels);
+ let mono = stereo_to_mono(bytemuck::cast_slice(data), channels);
let _ = audio_queue_clone.push(mono);
}
@@ -218,7 +218,7 @@ pub async fn record_and_transcribe(
.upgrade()
.map_or(false, |arc| arc.load(Ordering::Relaxed))
{
- let mono = converge_to_mono(bytemuck::cast_slice(data), channels);
+ let mono = stereo_to_mono(bytemuck::cast_slice(data), channels);
let _ = audio_queue_clone.push(mono);
}
@@ -233,7 +233,7 @@ pub async fn record_and_transcribe(
.upgrade()
.map_or(false, |arc| arc.load(Ordering::Relaxed))
{
- let mono = converge_to_mono(bytemuck::cast_slice(data), channels);
+ let mono = stereo_to_mono(bytemuck::cast_slice(data), channels);
let _ = audio_queue_clone.push(mono);
}
@@ -248,7 +248,7 @@ pub async fn record_and_transcribe(
.upgrade()
.map_or(false, |arc| arc.load(Ordering::Relaxed))
{
- let mono = converge_to_mono(data, channels);
+ let mono = stereo_to_mono(data, channels);
let _ = audio_queue_clone.push(mono);
}