From 137eed9aa2733bd0f4fb5c5933a6bc10a629a7d1 Mon Sep 17 00:00:00 2001 From: ghaisan Date: Wed, 9 Oct 2024 20:25:57 +0700 Subject: [PATCH] readme update --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ec09f11..ca4bf7d 100644 --- a/README.md +++ b/README.md @@ -13,37 +13,41 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -morse_rs = "0.1.2" +morse_rs = "0.1.3" ``` ## Usage -Converts a string to morse then writes the encoded message into a wav file. +Converts a string to morse then writes the encoded message into a wav file, specifying the pause times. ```rust -use morse_rs::{to_morse, write_morse}; +use morse_rs::{to_morse, write_morse_to_file}; fn main() { let my_message = "attack at noon"; let morse = to_morse(my_message); - write_morse("my_message.wav", &morse); + write_morse_to_file("my_message.wav", &morse, 150.0, 200.0); } + ``` -We can also write the morse into a buffer in memory +We can also write the morse into a buffer in memory, doing so allows the use of transferring data with WebAssembly. ```rust -use morse_rs::{to_morse, write_morse}; +use morse_rs::{to_morse, write_morse_in_memory}; -fn main() { - let my_message = "attack at noon"; - let morse = to_morse_inmemory(my_message); +#[wasm_bindgen] +pub fn generate_morse_sound(s: String) -> Vec { + let encoded = to_morse(&s); + let sound = write_morse_in_memory(encoded, 150.0, 200.0); - write_morse("my_message.wav", &morse); + sound } + ``` ## TODO - Decode morse from sound -- Add proper rust like error return types +- Solve the Riemann Hypothesis +