From d81a1a516783896b2d2ac2404c6f31ab06432375 Mon Sep 17 00:00:00 2001 From: polsevev Date: Sat, 4 Mar 2023 23:29:56 +0100 Subject: [PATCH] Added processing screen --- src/soundGenerator.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/soundGenerator.rs b/src/soundGenerator.rs index 94b79b6..3805e72 100644 --- a/src/soundGenerator.rs +++ b/src/soundGenerator.rs @@ -1,6 +1,6 @@ use std::f32::consts::PI; -use macroquad::audio::{Sound, load_sound_from_bytes}; +use macroquad::{audio::{Sound, load_sound_from_bytes}, window::{next_frame, screen_width, screen_height}, text::draw_text, prelude::BLACK}; const CHUNK_ID:&str = "RIFF"; @@ -69,7 +69,10 @@ pub async fn generateTone(frequency: f32, duration:f32) -> Sound{ let channel = (amplitude * value); collect.push(channel); - soundFileBytes.append(&mut (channel as i16).to_le_bytes().to_vec()) + soundFileBytes.append(&mut (channel as i16).to_le_bytes().to_vec()); + + draw_text("Processing Audio beeps!", (screen_width() / 2.)-170.0, screen_height()*0.1, 100.0, BLACK); + next_frame().await } let endAudio = soundFileBytes.len();