Files
zed/crates/audio/src/audio.rs
T
28687ff9d1 audio: Remove rodio audio backend (#51945)
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>

We've decided to remove rodio backend for audio as we didn't have time
to get it to a nice spot. I personally believe we should eventually
re-land it (the composable pipelines are quite nice!), but given that we
need audio to work, this seems like the best way forward. We won't have
to worry about all the ways in which the legacy pipeline interoped with
rodio's.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- audio: Experimental rodio audio backend has been removed.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Yara <git@yara.blue>
2026-03-24 00:58:09 +01:00

48 lines
1.3 KiB
Rust

use std::time::Duration;
use rodio::{ChannelCount, SampleRate, nz};
pub const REPLAY_DURATION: Duration = Duration::from_secs(30);
pub const SAMPLE_RATE: SampleRate = nz!(48000);
pub const CHANNEL_COUNT: ChannelCount = nz!(2);
mod audio_settings;
pub use audio_settings::AudioSettings;
pub use audio_settings::LIVE_SETTINGS;
mod audio_pipeline;
pub use audio_pipeline::Audio;
pub use audio_pipeline::{AudioDeviceInfo, AvailableAudioDevices};
pub use audio_pipeline::{ensure_devices_initialized, resolve_device};
// TODO(audio) replace with input test functionality in the audio crate
pub use audio_pipeline::RodioExt;
pub use audio_pipeline::init;
pub use audio_pipeline::{open_input_stream, open_test_output};
#[derive(Debug, Copy, Clone, Eq, Hash, PartialEq)]
pub enum Sound {
Joined,
GuestJoined,
Leave,
Mute,
Unmute,
StartScreenshare,
StopScreenshare,
AgentDone,
}
impl Sound {
fn file(&self) -> &'static str {
match self {
Self::Joined => "joined_call",
Self::GuestJoined => "guest_joined_call",
Self::Leave => "leave_call",
Self::Mute => "mute",
Self::Unmute => "unmute",
Self::StartScreenshare => "start_screenshare",
Self::StopScreenshare => "stop_screenshare",
Self::AgentDone => "agent_done",
}
}
}