Skip to content

Commit

Permalink
New audio mixer (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechBarczynski authored Mar 19, 2024
1 parent 1b696a4 commit 9357efe
Show file tree
Hide file tree
Showing 22 changed files with 428 additions and 261 deletions.
14 changes: 7 additions & 7 deletions compositor_pipeline/src/audio_mixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ use std::sync::{Arc, Mutex};
use compositor_render::{error::UpdateSceneError, OutputId};
use tracing::trace;

use self::{
internal_audio_mixer::InternalAudioMixer,
types::{AudioChannels, AudioMixingParams, AudioSamplesSet, OutputSamples},
};
use self::internal_audio_mixer::InternalAudioMixer;

mod internal_audio_mixer;
pub mod types;
mod types;

pub use types::*;

#[derive(Debug, Clone)]
pub(super) struct AudioMixer(Arc<Mutex<InternalAudioMixer>>);
Expand All @@ -21,7 +20,7 @@ impl AudioMixer {
))))
}

pub fn mix_samples(&self, samples_set: AudioSamplesSet) -> OutputSamples {
pub fn mix_samples(&self, samples_set: InputSamplesSet) -> OutputSamplesSet {
trace!(set=?samples_set, "Mixing samples");
self.0.lock().unwrap().mix_samples(samples_set)
}
Expand All @@ -30,12 +29,13 @@ impl AudioMixer {
&self,
output_id: OutputId,
audio: AudioMixingParams,
mixing_strategy: MixingStrategy,
channels: AudioChannels,
) {
self.0
.lock()
.unwrap()
.register_output(output_id, audio, channels)
.register_output(output_id, audio, mixing_strategy, channels)
}

pub fn unregister_output(&self, output_id: &OutputId) {
Expand Down
Loading

0 comments on commit 9357efe

Please sign in to comment.