HLE DSP: Implement AAC audio decoder

This commit is contained in:
wheremyfoodat 2024-09-05 00:06:48 +03:00
parent 9055076d0d
commit 545bbd5c45
5 changed files with 178 additions and 5 deletions

View file

@ -0,0 +1,24 @@
#pragma once
#include <functional>
#include "audio/aac.hpp"
#include "helpers.hpp"
struct AAC_DECODER_INSTANCE;
namespace Audio::AAC {
class Decoder {
using DecoderHandle = AAC_DECODER_INSTANCE*;
using PaddrCallback = std::function<u8*(u32)>;
DecoderHandle decoderHandle = nullptr;
bool isInitialized() { return decoderHandle != nullptr; }
void initialize();
public:
// Decode function. Takes in a reference to the AAC response & request, and a callback for paddr -> pointer conversions
void decode(AAC::Message& response, const AAC::Message& request, PaddrCallback paddrCallback);
~Decoder();
};
} // namespace Audio::AAC