This commit is contained in:
Pierre Krieger 2015-03-26 10:03:13 +01:00
parent 1adfa820c6
commit a6c1b14d66
9 changed files with 14 additions and 14 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "cpal"
version = "0.0.16"
version = "0.0.17"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
description = "Cross-platform audio playing library in pure Rust."
repository = "https://github.com/tomaka/cpal"

View File

@ -1,7 +1,7 @@
[package]
name = "alsa-sys"
version = "0.0.5"
version = "0.0.6"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
build = "build.rs"
description = "Bindings for the ALSA project (Advanced Linux Sound Architecture)"

View File

@ -1,4 +1,4 @@
extern crate "pkg-config" as pkg_config;
extern crate pkg_config;
fn main() {
pkg_config::find_library("alsa").unwrap();

View File

@ -14,7 +14,7 @@ fn main() {
let packet = packet.unwrap();
let vorbis::Packet { channels, rate, data, .. } = packet;
let mut data = data.as_slice();
let mut data = &data[..];
loop {
if data.len() == 0 {

View File

@ -1,4 +1,4 @@
extern crate "alsa-sys" as alsa;
extern crate alsa_sys as alsa;
extern crate libc;
use std::{ffi, iter, mem};

View File

@ -1,4 +1,4 @@
extern crate "coreaudio-rs" as coreaudio;
extern crate coreaudio_rs as coreaudio;
extern crate libc;
use self::coreaudio::audio_unit::{AudioUnit, Type, SubType};

View File

@ -47,7 +47,7 @@ a conversion on your data.
If you have the possibility, you should try to match the format of the voice.
*/
#![feature(box_syntax, core, unsafe_destructor)]
#![feature(box_syntax, core, unsafe_destructor, thread_sleep, std_misc)]
#![unstable]
pub use samples_formats::{SampleFormat, Sample};
@ -269,14 +269,14 @@ impl<'a, T> Drop for Buffer<'a, T> where T: Sample {
let buffer = conversion.intermediate_buffer;
let buffer = if conversion.from_channels != conversion.to_channels {
conversions::convert_channels(buffer.as_slice(), conversion.from_channels,
conversions::convert_channels(&buffer, conversion.from_channels,
conversion.to_channels)
} else {
buffer
};
let buffer = if conversion.from_sample_rate != conversion.to_sample_rate {
conversions::convert_samples_rate(buffer.as_slice(), conversion.from_sample_rate,
conversions::convert_samples_rate(&buffer, conversion.from_sample_rate,
conversion.to_sample_rate,
conversion.to_channels)
} else {
@ -309,15 +309,15 @@ impl<'a, T> Drop for Buffer<'a, T> where T: Sample {
match conversion.to_format {
SampleFormat::I16 => {
let buffer = Sample::to_vec_i16(buffer.as_slice());
let buffer = Sample::to_vec_i16(&buffer);
write_to_buf!(buffer, output, i16);
},
SampleFormat::U16 => {
let buffer = Sample::to_vec_u16(buffer.as_slice());
let buffer = Sample::to_vec_u16(&buffer);
write_to_buf!(buffer, output, u16);
},
SampleFormat::F32 => {
let buffer = Sample::to_vec_f32(buffer.as_slice());
let buffer = Sample::to_vec_f32(&buffer);
write_to_buf!(buffer, output, f32);
},
}

View File

@ -63,7 +63,7 @@ impl Sample for u16 {
}
fn to_vec_f32(input: &[u16]) -> Cow<[f32]> {
Cow::Owned(Sample::to_vec_f32(Sample::to_vec_i16(input).as_slice()).to_vec())
Cow::Owned(Sample::to_vec_f32(&Sample::to_vec_i16(input)).to_vec())
}
}

View File

@ -1,6 +1,6 @@
extern crate libc;
extern crate winapi;
extern crate "ole32-sys" as ole32;
extern crate ole32_sys as ole32;
use std::{slice, mem, ptr};
use std::marker::PhantomData;