Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/tools/example-showcase/disable-audio.patch
6595 views
1
diff --git a/crates/bevy_audio/src/audio_output.rs b/crates/bevy_audio/src/audio_output.rs
2
index 3e8082e23..624769443 100644
3
--- a/crates/bevy_audio/src/audio_output.rs
4
+++ b/crates/bevy_audio/src/audio_output.rs
5
@@ -7,7 +7,7 @@ use bevy_ecs::{prelude::*, system::SystemParam};
6
use bevy_math::Vec3;
7
use bevy_transform::prelude::GlobalTransform;
8
-use rodio::{OutputStream, OutputStreamHandle, Sink, Source, SpatialSink};
9
+use rodio::{OutputStreamHandle, Sink, Source, SpatialSink};
10
use tracing::warn;
11
12
use crate::{AudioSink, AudioSinkPlayback};
13
14
@@ -30,18 +30,10 @@ pub(crate) struct AudioOutput {
15
16
impl Default for AudioOutput {
17
fn default() -> Self {
18
- if let Ok((stream, stream_handle)) = OutputStream::try_default() {
19
- // We leak `OutputStream` to prevent the audio from stopping.
20
- core::mem::forget(stream);
21
- Self {
22
- stream_handle: Some(stream_handle),
23
- }
24
- } else {
25
warn!("No audio device found.");
26
Self {
27
stream_handle: None,
28
}
29
- }
30
}
31
}
32
33
34