1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Loading and playing of audio files.
extern crate amethyst_assets;
extern crate amethyst_core;
extern crate cpal;
extern crate rodio;
extern crate shred;
extern crate smallvec;
extern crate specs;

pub use self::bundle::AudioBundle;
pub use self::components::*;
pub use self::formats::{FlacFormat, OggFormat, WavFormat};
pub use self::sink::AudioSink;
pub use self::source::{Source, SourceHandle};
pub use self::systems::*;

pub mod output;

use std::error::Error;
use std::fmt::{Display, Formatter, Result as FmtResult};

mod formats;
mod sink;
mod source;
mod components;
mod systems;
mod bundle;

/// An error occurred while decoding the source.
#[derive(Debug)]
pub struct DecoderError;

impl Display for DecoderError {
    fn fmt(&self, formatter: &mut Formatter) -> FmtResult {
        formatter.write_str("DecoderError")
    }
}

impl Error for DecoderError {
    fn description(&self) -> &str {
        "An error occurred while decoding sound data."
    }

    fn cause(&self) -> Option<&Error> {
        None
    }
}