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

Merge branch 'main' into fix-#199

Louis Beaumont2dad0f7d80ea
diff --cc screenpipe-audio/src/core.rs
index 9e74693ad,c04870e70..9e2a9dab0
--- a/screenpipe-audio/src/core.rs
+++ b/screenpipe-audio/src/core.rs
@@@ -15,7 -15,20 +15,8 @@@ use tokio::process::Command
use tokio::sync::mpsc::{self, UnboundedSender};
use crate::AudioInput;
-#[cfg(target_os = "macos")]
-use once_cell::sync::Lazy;
-#[cfg(target_os = "macos")]
-static MACOS_VERSION: Lazy<f32> = Lazy::new(|| get_macos_version().unwrap_or(0.0));
-#[cfg(target_os = "macos")]
-fn get_macos_version() -> Option<f32> {
- let output = std::process::Command::new("sw_vers")
- .arg("-productVersion")
- .output()
- .ok()?;
- let version = String::from_utf8(output.stdout).ok()?;
- version.split('.').next()?.parse().ok()
-}
+
+
#[derive(Clone, Debug, PartialEq)]
pub enum AudioTranscriptionEngine {
Deepgram,
@@@ -421,11 -481,14 +460,12 @@@ pub fn default_input_device() -> Result
pub async fn default_output_device() -> Result<AudioDevice> {
#[cfg(target_os = "macos")]
{
+ let version = *MACOS_VERSION;
// ! see https://github.com/RustAudio/cpal/pull/894
- if version < 15.0 {
- if let Ok(host) = cpal::host_from_id(cpal::HostId::ScreenCaptureKit) {
- if let Some(device) = host.default_input_device() {
- if let Ok(name) = device.name() {
- return Ok(AudioDevice::new(name, DeviceType::Output));
- }
+ if let Ok(host) = cpal::host_from_id(cpal::HostId::ScreenCaptureKit) {
+ if let Some(device) = host.default_input_device() {
+ if let Ok(name) = device.name() {
+ return Ok(AudioDevice::new(name, DeviceType::Output));
}
}
}