Why Disable Audio?
You probably don’t want to disable audio. Unless, that is, your audio setup is giving you issues and impeding development.
In my case, I get an error message from the Rodio crate that Bevy uses that looks like this:
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave thread 'main' panicked at 'The device doesn't support any format!?: DeviceNotAvailable', /home/spencer/code/project/audiofile.rs:10:10
In my case, it seems that Rodio is trying to connect to ALSA instead of Pulseaudio. This is a problem because ALSA only supports one output, hence the need for Pulseaudio (which is probably using that single output and acting like a virtual splitter jack). This specific issue is tracked on GitHub here.
Bevy comes with a Cargo feature that enables audio by default. There is a full list of features in the docs and in Cargo.toml.
Anyways, go to your project’s
Cargo.toml, remove the
bevy line from under
[dependencies] and add the following:
[dependencies.bevy] version = "0.4" default-features = false features = ["bevy_gltf", "bevy_winit", "bevy_wgpu", "render", "bevy_dynamic_plugin", "png", "hdr", "x11"]
This does three things:
- Replaces the
bevyline we just removed
- Tells Cargo that we don’t want Bevy’s default features
- Tells Cargo that we want every default feature except
Hope this helped.