Changed up how resources import/export files. Added Model codecs.

This commit is contained in:
2024-02-20 22:47:52 -08:00
parent 54012df3a1
commit 93f881cf03
20 changed files with 998 additions and 882 deletions

View File

@@ -39,7 +39,7 @@ namespace ehs
Audio();
Audio(Str_8 id);
Audio(const Str_8& filePath);
Audio(Str_8 id, UInt_64 sampleRate, DataType dataType, UInt_8 channels, UInt_64 frames, const Byte* data);
@@ -123,17 +123,7 @@ namespace ehs
Audio GetAsChannels(UInt_8 newChannels) const;
bool ToFile(const Str_8& filePath) const;
static Audio FromFile(const Str_8& filePath);
static Audio* FromFile_Heap(const Str_8& filePath);
static Audio FromFile(const Str_8& filePath, DataType required);
static Audio* FromFile_Heap(const Str_8& filePath, DataType required);
static Audio FromData(Str_8 id, const Str_8& ext, Serializer<UInt_64>& data);
bool Export(const Str_8& filePath) const;
private:
void ToMono(UInt_64 newFrameCount, Byte* newData, UInt_64 frameOffset) const;
@@ -201,4 +191,10 @@ namespace ehs
void SInt_32_to_SInt_64(Byte* newData, Byte* newPeak) const;
};
bool EncodeEHA(const ehs::AudioCodec* codec, ehs::Serializer<ehs::UInt_64>& out, const ehs::Audio* in);
bool DecodeEHA(const ehs::AudioCodec* codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Audio* out);
bool DecodeWAV(const ehs::AudioCodec* codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Audio* out);
}