mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-15 05:02:13 -04:00
Bugfix: wave file samplerate and size not being written
This commit is contained in:
parent
09611ba9eb
commit
aec41cab91
3 changed files with 5 additions and 6 deletions
|
@ -89,9 +89,9 @@ uint16_t WAVFileReader::bits_per_sample() {
|
||||||
|
|
||||||
Optional<File::Error> WAVFileWriter::create(
|
Optional<File::Error> WAVFileWriter::create(
|
||||||
const std::filesystem::path& filename,
|
const std::filesystem::path& filename,
|
||||||
size_t sampling_rate
|
size_t sampling_rate_set
|
||||||
) {
|
) {
|
||||||
sampling_rate = sampling_rate;
|
sampling_rate = sampling_rate_set;
|
||||||
const auto create_error = FileWriter::create(filename);
|
const auto create_error = FileWriter::create(filename);
|
||||||
if( create_error.is_valid() ) {
|
if( create_error.is_valid() ) {
|
||||||
return create_error;
|
return create_error;
|
||||||
|
|
|
@ -155,7 +155,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t sampling_rate { 0 };
|
uint32_t sampling_rate { 0 };
|
||||||
uint32_t bytes_written { 0 };
|
|
||||||
|
|
||||||
Optional<File::Error> update_header();
|
Optional<File::Error> update_header();
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,7 +49,7 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
||||||
else
|
else
|
||||||
pwmrssi_audio_buffer.p[c] = -32768;
|
pwmrssi_audio_buffer.p[c] = -32768;
|
||||||
|
|
||||||
if (synth_acc < synth_div) // 24kHz / 30 = 800Hz
|
if (synth_acc < synth_div)
|
||||||
synth_acc++;
|
synth_acc++;
|
||||||
else
|
else
|
||||||
synth_acc = 0;
|
synth_acc = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue