// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: MPL-2.0 #pragma once #include #include #include #include #include #include namespace Core::Memory { class Memory; } namespace AudioCore::AudioRenderer { struct DecodeFromWaveBuffersArgs { SampleFormat sample_format; std::span output; VoiceState* voice_state; std::span wave_buffers; s8 channel; s8 channel_count; SrcQuality src_quality; f32 pitch; u32 source_sample_rate; u32 target_sample_rate; u32 sample_count; CpuAddr data_address; u64 data_size; bool IsVoicePlayedSampleCountResetAtLoopPointSupported; bool IsVoicePitchAndSrcSkippedSupported; }; struct DecodeArg { CpuAddr buffer; u64 buffer_size; u32 start_offset; u32 end_offset; s8 channel_count; std::array coefficients; VoiceState::AdpcmContext* adpcm_context; s8 target_channel; u32 offset; u32 samples_to_read; }; /** * Decode wavebuffers according to the given args. * * @param memory - Core memory to read data from. * @param args - The wavebuffer data, and information for how to decode it. */ void DecodeFromWaveBuffers(Core::Memory::Memory& memory, const DecodeFromWaveBuffersArgs& args); } // namespace AudioCore::AudioRenderer