feat: macos, audio, loopback (#10025)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-11-23 18:41:27 +08:00
committed by GitHub
parent 02b046bdbf
commit 0973f51df9
9 changed files with 105 additions and 21 deletions

View File

@@ -321,6 +321,8 @@ pub fn get_sound_inputs() -> Vec<String> {
fn get_sound_inputs_() -> Vec<String> {
let mut out = Vec::new();
use cpal::traits::{DeviceTrait, HostTrait};
// Do not use `cpal::host_from_id(cpal::HostId::ScreenCaptureKit)` for feature = "screencapturekit"
// Because we explicitly handle the "System Sound" device.
let host = cpal::default_host();
if let Ok(devices) = host.devices() {
for device in devices {