@@ -2,7 +2,7 @@ use super::{Open, Sink, SinkError, SinkResult};
2
2
use crate :: config:: AudioFormat ;
3
3
use crate :: convert:: Converter ;
4
4
use crate :: decoder:: AudioPacket ;
5
- use crate :: { NUM_CHANNELS , SAMPLE_RATE } ;
5
+ use crate :: NUM_CHANNELS ;
6
6
use portaudio_rs:: device:: { get_default_output_index, DeviceIndex , DeviceInfo } ;
7
7
use portaudio_rs:: stream:: * ;
8
8
use std:: process:: exit;
@@ -141,9 +141,9 @@ impl<'a> Sink for PortAudioSink<'a> {
141
141
} } ;
142
142
}
143
143
match self {
144
- Self :: F32 ( stream, _) => stop_sink ! ( ref mut stream) ,
145
- Self :: S32 ( stream, _) => stop_sink ! ( ref mut stream) ,
146
- Self :: S16 ( stream, _) => stop_sink ! ( ref mut stream) ,
144
+ Self :: F32 ( stream, _, _ ) => stop_sink ! ( ref mut stream) ,
145
+ Self :: S32 ( stream, _, _ ) => stop_sink ! ( ref mut stream) ,
146
+ Self :: S16 ( stream, _, _ ) => stop_sink ! ( ref mut stream) ,
147
147
} ;
148
148
149
149
Ok ( ( ) )
@@ -161,15 +161,15 @@ impl<'a> Sink for PortAudioSink<'a> {
161
161
. map_err ( |e| SinkError :: OnWrite ( e. to_string ( ) ) ) ?;
162
162
163
163
let result = match self {
164
- Self :: F32 ( stream, _parameters) => {
164
+ Self :: F32 ( stream, _parameters, _sample_rate ) => {
165
165
let samples_f32: & [ f32 ] = & converter. f64_to_f32 ( samples) ;
166
166
write_sink ! ( ref mut stream, samples_f32)
167
167
}
168
- Self :: S32 ( stream, _parameters) => {
168
+ Self :: S32 ( stream, _parameters, _sample_rate ) => {
169
169
let samples_s32: & [ i32 ] = & converter. f64_to_s32 ( samples) ;
170
170
write_sink ! ( ref mut stream, samples_s32)
171
171
}
172
- Self :: S16 ( stream, _parameters) => {
172
+ Self :: S16 ( stream, _parameters, _sample_rate ) => {
173
173
let samples_s16: & [ i16 ] = & converter. f64_to_s16 ( samples) ;
174
174
write_sink ! ( ref mut stream, samples_s16)
175
175
}
0 commit comments