mirror of
https://github.com/ghaisanghaisan/morse_rs.git
synced 2026-08-12 05:46:19 -05:00
write_freq used hard coded values
This commit is contained in:
+3
-2
@@ -4,13 +4,14 @@ use std::f32::consts::PI;
|
|||||||
use std::{fs, i16, io};
|
use std::{fs, i16, io};
|
||||||
|
|
||||||
const SAMPLE_RATE: f32 = 44100.0;
|
const SAMPLE_RATE: f32 = 44100.0;
|
||||||
|
const BITS_PER_SAMPLE: u16 = 16;
|
||||||
const MORSE_FREQ: f32 = 600.0;
|
const MORSE_FREQ: f32 = 600.0;
|
||||||
const UNIT_TIME: f32 = 100.0 / 1000.0; // IN MS
|
const UNIT_TIME: f32 = 100.0 / 1000.0; // IN MS
|
||||||
|
|
||||||
const SPEC: hound::WavSpec = hound::WavSpec {
|
const SPEC: hound::WavSpec = hound::WavSpec {
|
||||||
channels: 1,
|
channels: 1,
|
||||||
sample_rate: 44100,
|
sample_rate: SAMPLE_RATE as u32,
|
||||||
bits_per_sample: 16,
|
bits_per_sample: BITS_PER_SAMPLE,
|
||||||
sample_format: hound::SampleFormat::Int,
|
sample_format: hound::SampleFormat::Int,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user