Audio sucks
This commit is contained in:
parent
d81a1a5167
commit
b9c6fd24d7
2 changed files with 3 additions and 3 deletions
|
@ -68,6 +68,7 @@ impl SortingList for GuiVec{
|
||||||
let colorStep = 360./length as f32;
|
let colorStep = 360./length as f32;
|
||||||
let mut list:Vec<Bar> = vec!();
|
let mut list:Vec<Bar> = vec!();
|
||||||
let freqStep = 50. + ((2000.-50.)/length as f32);
|
let freqStep = 50. + ((2000.-50.)/length as f32);
|
||||||
|
|
||||||
for i in 1..length+1 {
|
for i in 1..length+1 {
|
||||||
let frequency = i as f32 * freqStep;
|
let frequency = i as f32 * freqStep;
|
||||||
list.push(Bar::new(i, (colorStep*i as f32)/360., frequency).await);
|
list.push(Bar::new(i, (colorStep*i as f32)/360., frequency).await);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::f32::consts::PI;
|
use std::f32::consts::PI;
|
||||||
|
|
||||||
use macroquad::{audio::{Sound, load_sound_from_bytes}, window::{next_frame, screen_width, screen_height}, text::draw_text, prelude::BLACK};
|
use macroquad::{audio::{Sound, load_sound_from_bytes}, window::{next_frame, screen_width, screen_height, clear_background}, text::draw_text, prelude::{BLACK, WHITE}};
|
||||||
|
|
||||||
|
|
||||||
const CHUNK_ID:&str = "RIFF";
|
const CHUNK_ID:&str = "RIFF";
|
||||||
|
@ -71,8 +71,7 @@ pub async fn generateTone(frequency: f32, duration:f32) -> Sound{
|
||||||
collect.push(channel);
|
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();
|
let endAudio = soundFileBytes.len();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue