File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1- use rodio:: { output_to_wav , Source } ;
1+ use rodio:: { wav_to_file , Source } ;
22use std:: error:: Error ;
33
44/// Converts mp3 file to a wav file.
@@ -12,7 +12,7 @@ fn main() -> Result<(), Box<dyn Error>> {
1212
1313 let wav_path = "music_mp3_converted.wav" ;
1414 println ! ( "Storing converted audio into {}" , wav_path) ;
15- output_to_wav ( & mut audio, wav_path) ?;
15+ wav_to_file ( & mut audio, wav_path) ?;
1616
1717 Ok ( ( ) )
1818}
Original file line number Diff line number Diff line change 11use crate :: common:: assert_error_traits;
2- use crate :: Source ;
32use crate :: Sample ;
3+ use crate :: Source ;
44use hound:: { SampleFormat , WavSpec } ;
55use std:: io:: { self , Write } ;
66use std:: path;
@@ -94,10 +94,10 @@ pub fn wav_to_writer(
9494 Ok ( ( ) )
9595}
9696
97- struct WholeFrames < I : Iterator < Item = Sample > > {
97+ struct WholeFrames < I : Iterator < Item = Sample > > {
9898 buffer : Vec < Sample > ,
9999 pos : usize ,
100- source : I
100+ source : I ,
101101}
102102
103103impl < S : Source > WholeFrames < S > {
@@ -120,14 +120,13 @@ impl<I: Iterator<Item = Sample>> Iterator for WholeFrames<I> {
120120 }
121121 self . pos = 0 ;
122122 }
123-
123+
124124 let to_yield = self . buffer [ self . pos ] ;
125125 self . pos += 1 ;
126126 Some ( to_yield)
127127 }
128128}
129129
130-
131130#[ cfg( test) ]
132131mod test {
133132 use super :: wav_to_file;
You can’t perform that action at this time.
0 commit comments