jak-project/common/audio/audio_formats.h
Tyler Wilding 6446389263
extractor: cleanup, support unicode properly, and add multi-game support (#1609)
* extractor: refactor and cleanup for multi-game support

* deps: switch to `ghc::filesystem` as it is utf-8 everywhere by default

* extractor: finally working with unicode

* unicode: fix unicode cli args on windows in all `main` functions
2022-07-05 20:38:13 -04:00

37 lines
766 B
C++

#pragma once
#include <string>
#include <vector>
#include "common/common_types.h"
#include "common/util/BinaryReader.h"
#include "common/util/FileUtil.h"
// The header data for a simple wave file
struct WaveFileHeader {
// wave file header
char chunk_id[4];
s32 chunk_size;
char format[4];
// format chunk
char subchunk1_id[4];
s32 subchunk1_size;
s16 aud_format;
s16 num_channels;
s32 sample_rate;
s32 byte_rate;
s16 block_align;
s16 bits_per_sample;
// data chunk
char subchunk2_id[4];
s32 subchunk2_size;
};
void write_wave_file_mono(const std::vector<s16>& samples, s32 sample_rate, const fs::path& name);
std::vector<s16> decode_adpcm(BinaryReader& reader);
std::vector<u8> encode_adpcm(const std::vector<s16>& samples);