mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
6446389263
* 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
37 lines
766 B
C++
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);
|