Skip to content

Cross platform desktop audio recording? #35

@nestarz

Description

@nestarz

Hello @AldaronLau !

I am following your answer you made at the exact same question I am asking now but on reddit Cross platform desktop audio recording, do you know if it's already doable with your crate ? And if not do you know any other way to do it without configuring the audio output as input, maybe with https://github.com/RustAudio/rust-jack ?

I am asking this mainly because I can't run modprobe snd-aloop to create a loopback in my environment (bc its linux container on an arbitrary kernel that will not support module snd-aloop and netiher its host).

Thanks for your work !

I tried with no luck this adaptation of your test code:

use fon::{stereo::Stereo32, Sink, Audio};
use pasts::{exec, wait};
use wavy::{Speakers, SpeakersSink};

enum Event<'a> {
    Record(SpeakersSink<'a, Stereo32>),
}

struct State {
    buffer: Audio<Stereo32>,
}

impl State {
    fn event(&mut self, event: Event<'_>) {
        match event {
            Event::Record(microphone) => self.buffer.extend(microphone),
        }
    }
}

/// Program start.
fn main() {
    let mut state = State { buffer: Audio::with_silence(48_000, 0) };
    let mut speakers = Speakers::default();

    exec!(state.event(wait! {
        Event::Record(speakers.play().await),
    }));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions