2021-04-30 17:25:39 +00:00
|
|
|
# rodio-xm
|
|
|
|
|
2021-11-27 11:49:47 +00:00
|
|
|
provides a Source for playback of FastTracker 2 extended modules in rodio
|
2021-11-27 11:41:32 +00:00
|
|
|
|
|
|
|
## examples
|
|
|
|
|
|
|
|
```rust
|
2021-11-27 11:49:47 +00:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
use rodio::{OutputStream, Sink};
|
2021-11-27 11:41:32 +00:00
|
|
|
use rodio_xm::XMSource;
|
|
|
|
|
|
|
|
fn main() {
|
2021-11-27 11:49:47 +00:00
|
|
|
let source = XMSource::from_file(
|
|
|
|
PathBuf::from("path/to/file.xm"),
|
|
|
|
44100
|
|
|
|
);
|
2021-11-27 11:41:32 +00:00
|
|
|
|
2021-11-27 11:49:47 +00:00
|
|
|
let (_stream, stream_handle) = OutputStream::try_default().unwrap();
|
|
|
|
let sink = Sink::try_new(&stream_handle).unwrap();
|
2021-11-27 11:41:32 +00:00
|
|
|
|
|
|
|
sink.append(source);
|
2021-11-27 11:49:47 +00:00
|
|
|
sink.play();
|
|
|
|
|
|
|
|
loop {}
|
2021-11-27 11:41:32 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
see more in the *examples* directory.
|
|
|
|
|
|
|
|
## license
|
|
|
|
|
2021-11-27 11:49:47 +00:00
|
|
|
released under the MIT license.
|
|
|
|
|
|
|
|
example track ["Chica-pop!"](https://modarchive.org/index.php?request=view_by_moduleid&query=189433)
|
|
|
|
is in the public domain.
|