diff --git a/Cargo.lock b/Cargo.lock index 9c0e4a0..27c27cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f" [[package]] name = "morse_rs" -version = "0.1.3" +version = "0.1.5" dependencies = [ "hound", ] diff --git a/Cargo.toml b/Cargo.toml index d3fd81c..9a80e3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "morse_rs" description = "A simple morse code translator, with the abilty to write to WAV files using Hound." license = "MIT" -version = "0.1.4" +version = "0.1.41" edition = "2021" [dependencies] diff --git a/README.md b/README.md index cb15960..925789d 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,6 @@ A simple Morse code translator written in Rust, with the ability to write Morse - Translate text to Morse code and vice versa - Generate WAV files from Morse code sequences -## Installation - -Add this to your `Cargo.toml`: - -```toml -[dependencies] -morse_rs = "0.1.4" -``` - ## Usage Converts a string to morse then writes the encoded message into a wav file, specifying the pause times. diff --git a/src/lib.rs b/src/lib.rs index e1b39d9..8ae024a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,6 +233,10 @@ pub fn write_morse_in_memory( pause_between_char_time: f32, pause_between_words_time: f32, ) -> Vec { + // Convert from MS; + let pause_between_char_time = pause_between_char_time / 1000.0; + let pause_between_words_time = pause_between_words_time / 1000.0; + let mut buffer = Vec::new(); // Create a buffer to hold the WAV data { let mut writer = hound::WavWriter::new(Cursor::new(&mut buffer), SPEC).unwrap();