DirectXTK12/Audio/WAVFileReader.h

57 строки
1.6 KiB
C
Исходник Обычный вид История

2016-10-29 02:02:21 +03:00
//--------------------------------------------------------------------------------------
// File: WAVFileReader.h
//
// Functions for loading WAV audio files
//
// Copyright (c) Microsoft Corporation. All rights reserved.
2018-02-24 09:08:23 +03:00
// Licensed under the MIT License.
2016-10-29 02:02:21 +03:00
//
// http://go.microsoft.com/fwlink/?LinkId=248929
2018-02-24 09:08:23 +03:00
// http://go.microsoft.com/fwlink/?LinkID=615561
2016-10-29 02:02:21 +03:00
//-------------------------------------------------------------------------------------
#pragma once
#include <stdint.h>
#include <objbase.h>
#include <memory>
#include <mmreg.h>
namespace DirectX
{
2018-05-02 05:13:50 +03:00
HRESULT LoadWAVAudioInMemory(
_In_reads_bytes_(wavDataSize) const uint8_t* wavData,
_In_ size_t wavDataSize,
_Outptr_ const WAVEFORMATEX** wfx,
_Outptr_ const uint8_t** startAudio,
_Out_ uint32_t* audioBytes);
HRESULT LoadWAVAudioFromFile(
_In_z_ const wchar_t* szFileName,
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
_Outptr_ const WAVEFORMATEX** wfx,
_Outptr_ const uint8_t** startAudio,
_Out_ uint32_t* audioBytes);
2016-10-29 02:02:21 +03:00
struct WAVData
{
const WAVEFORMATEX* wfx;
const uint8_t* startAudio;
uint32_t audioBytes;
uint32_t loopStart;
uint32_t loopLength;
const uint32_t* seek; // Note: XMA Seek data is Big-Endian
uint32_t seekCount;
};
2018-05-02 05:13:50 +03:00
HRESULT LoadWAVAudioInMemoryEx(
_In_reads_bytes_(wavDataSize) const uint8_t* wavData,
_In_ size_t wavDataSize,
_Out_ WAVData& result);
2016-10-29 02:02:21 +03:00
2018-05-02 05:13:50 +03:00
HRESULT LoadWAVAudioFromFileEx(
_In_z_ const wchar_t* szFileName,
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
_Out_ WAVData& result);
2016-06-17 05:00:12 +03:00
}