mirror of
https://github.com/RustAudio/rodio
synced 2025-03-04 15:07:18 +00:00
Fix period not being taken into account
This commit is contained in:
parent
d3a554b146
commit
8503bc2f8a
2 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,7 @@ repository = "https://github.com/tomaka/rodio"
|
|||
documentation = "http://tomaka.github.io/rodio/rodio/index.html"
|
||||
|
||||
[dependencies]
|
||||
cpal = "0.2.5"
|
||||
cpal = "0.2.7"
|
||||
hound = "1.0.0"
|
||||
lazy_static = "0.1.12"
|
||||
time = "0.1.32"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use std::cmp;
|
||||
use std::mem;
|
||||
use std::collections::HashMap;
|
||||
use std::io::{Read, Seek};
|
||||
|
@ -251,6 +252,7 @@ fn background(rx: Receiver<Command>) {
|
|||
|
||||
let mut buffer = {
|
||||
let samples_to_write = voice.get_samples_rate().0 * voice.get_channels() as u32 * FIXED_STEP_MS / 1000;
|
||||
let samples_to_write = cmp::max(samples_to_write, voice.get_period() as u32);
|
||||
voice.append_data(samples_to_write as usize)
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue