Skip to content

Latest commit

 

History

History

music-container

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Hex music-container - compress and encode audio

This crate is part of the Hex project and used to compress with Opus and encode to a loudspeaker independent format.

This library exists because the music data has to be stored in some way. One, simple, approach would be to use the MP3 format with stereo encoding all the time and just upmix or downmix different channel ordering. This would be sufficient for many cases, but not compatible to spatial audio or binaural reproduction. This crate followes therefore a different path. It encodes the raw audio to a source independent representation with Spherical Harmonics and compresses each SH channel with the Opus codec. Later on the audio file can be decoded again to any loudspeaker arrangement. (in limitation of the spatial resolution) Most of the SH codec calculation is missing for now, but can be added later on in a compatible way.

Example

extern crate hex_music_container;

use hex_music_container::{Configuration, Container};

fn main() {
    let container = Container::with_key("/tmp/music/data", "<key>").unwrap();

    let block = container.next_packet(Configuration::Stereo);
    println!("Got block n = {}", block.len());
}

License

Licensed under either of

at your option.

Contribution

If you have any question or suggestion please just open an issue in Github. Feel free to comment on particular features or suggest crazy, funny ideas. I would anticipate if you can have some use of Hex and improve it at the same time.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.