No description
Find a file
dis-da-moe 268dddae64
Force queue to play sources on frame boundaries (#455)
As I understand it, this is the issue:
  
     * Previously, when a queue has `keep_alive_if_empty` set to true, and it becomes empty, then it will push a silence lasting 10ms onto the queue.
 
     * This is an issue because `current_frame_len` would have returned the worst case, `512`, and the silence lasts less than that.
 
     * This means that unless the source is added immediately to the queue, and so a silence is never played, then the first actual source could start playing at a frame that is not aligned to its channels, or play at the wrong sample rate.
 
     * This is only determined by when the source is added to the queue after its initialization. This explains why the issue was inconsistent, as it relied on the speed of execution of code which is basically random.

Solution
 
     * Change the functionality of `Zero` to add a method to create a silence with a certain number of frames.
 
     * Replace the 10ms silence with a silence the length of `THRESHOLD`
 
     * Change queue's `current_frame_len` to return `THRESHOLD` if a silence will be played next.
2022-11-23 01:36:57 +01:00
.github/workflows Add optional Symphonia backend (#376) 2021-06-29 09:12:28 +02:00
assets Force queue to play sources on frame boundaries (#455) 2022-11-23 01:36:57 +01:00
examples Force queue to play sources on frame boundaries (#455) 2022-11-23 01:36:57 +01:00
src Force queue to play sources on frame boundaries (#455) 2022-11-23 01:36:57 +01:00
tests Move sound to assets/; Exclude it from package (#421) 2022-03-26 20:15:18 +01:00
.gitignore Initial commit 2015-07-22 12:14:11 +02:00
.rustfmt.toml Migrate to edition 2018 2020-05-02 13:33:57 +01:00
Cargo.toml Default to pure-Rust Symphonia for MP3 decoding (#453) 2022-11-12 05:08:36 +01:00
CHANGELOG.md Release version 0.16.0 (#441) 2022-09-14 14:43:27 +02:00
LICENSE-APACHE Require all new contributions to be MIT/Apache2 (#175) 2018-08-17 13:59:55 +02:00
LICENSE-MIT Require all new contributions to be MIT/Apache2 (#175) 2018-08-17 13:59:55 +02:00
README.md Default to pure-Rust Symphonia for MP3 decoding (#453) 2022-11-12 05:08:36 +01:00

Audio playback library

Crates.io Version Crates.io Downloads Build Status

Rust playback library.

Playback is handled by cpal. Format decoding can be handled either by Symphonia, or by format-specific decoders:

See the docs for more details on backends.

Documentation

The documentation contains an introduction to the library.

License

Licensed under either of

at your option.

License of your contributions

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.