Skip to content

Instantly share code, notes, and snippets.

View lonestarx1's full-sized avatar
🏠

Adriel Niyodusaba lonestarx1

🏠
  • Yonsei University
  • Seoul, South Korea
View GitHub Profile
@lonestarx1
lonestarx1 / main.rs
Created July 26, 2024 09:42
Recording System Output Audio on Mac
// brew install blackhole-2ch switchaudio-osx
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use hound::{WavSpec, WavWriter};
use std::process::Command;
use std::sync::{Arc, Mutex};
use std::time::Duration;
fn switch_audio_device(device_name: &str) -> bool {
let output = Command::new("SwitchAudioSource")