[READ-ONLY] Mirror of https://github.com/probablykasper/redlux. AAC decoder for MPEG-4 and AAC files, with rodio support
aac audio decoder mp4 package
0

Configure Feed

Select the types of activity you want to include in your feed.

Add `message` method for errors

Kasper (Feb 2, 2021, 4:41 AM +0100) 83dbd4db 5986c14d

+14 -3
-2
Cargo.toml
··· 16 16 mp4 = "0.8.1" 17 17 fdk-aac = "0.4.0" 18 18 rodio = { version = "0.13.0", default-features = false } 19 - 20 - [dev-dependencies]
+14 -1
src/lib.rs
··· 14 14 /// Unable to get information about a track, such as audio profile, sample 15 15 /// frequency or channel config. 16 16 TrackReadingError, 17 - // Unable to find track in file 17 + // Unable to find track in file 18 18 TrackNotFound, 19 19 /// Error decoding track 20 20 TrackDecodingError(DecoderError), ··· 25 25 } 26 26 27 27 impl error::Error for Error {} 28 + 29 + impl Error { 30 + pub fn message(&self) -> &'static str { 31 + match &self { 32 + Error::FileHeaderError => "Error reading file header", 33 + Error::TrackReadingError => "Error reading file track info", 34 + Error::TrackNotFound => "Unable to find track in file", 35 + Error::TrackDecodingError(_) => "Error decoding track", 36 + Error::SamplesError => "Error reading samples", 37 + Error::ReaderError(_) => "Error reading file", 38 + } 39 + } 40 + } 28 41 29 42 impl fmt::Display for Error { 30 43 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {