quad_snd/
lib.rs

1//! Loading and playing sounds.
2
3#![allow(warnings)]
4
5mod error;
6
7pub use error::Error;
8
9#[cfg(target_os = "android")]
10#[path = "opensles_snd.rs"]
11mod snd;
12
13#[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))]
14#[path = "alsa_snd.rs"]
15mod snd;
16
17#[cfg(any(target_os = "macos", target_os = "ios"))]
18#[path = "coreaudio_snd.rs"]
19mod snd;
20
21#[cfg(target_os = "windows")]
22#[path = "wasapi_snd.rs"]
23mod snd;
24
25#[cfg(target_arch = "wasm32")]
26#[path = "web_snd.rs"]
27mod snd;
28
29#[cfg(not(target_arch = "wasm32"))]
30mod mixer;
31
32pub use snd::{AudioContext, Playback, Sound};
33
34pub struct PlaySoundParams {
35    pub looped: bool,
36    pub volume: f32,
37}
38
39impl Default for PlaySoundParams {
40    fn default() -> PlaySoundParams {
41        PlaySoundParams {
42            looped: false,
43            volume: 1.,
44        }
45    }
46}