dl
dl_audio_loader.h
浏览该文件的文档.
1
12#pragma once
13
14#ifndef DL_DISABLE_AUDIO
15#include <string>
16#include "memory/dl_buffer.h"
17
18namespace dl
19{
20
22{
23public:
24 struct PCM
25 {
26 int _numChannel;//通道数 1,2 AL_FORMAT_MONO8,AL_FORMAT_STEREO8
27 int _bitPerSample;//采样数 8,16
29 size_t _freq;//采样率
30 };
31 static bool ReadWav(std::string_view path_name, PCM& pcm);
32 static bool ReadOgg(std::string_view path_name, PCM& pcm);
33 static bool ReadFlac(std::string_view path_name, PCM& pcm);
34 static bool ReadMp3(std::string_view path_name, PCM& pcm);
35
37};
38
39//16字节
41{
42 int16_t audioFormat;
43 int16_t numChannels;
44 int32_t sampleRate;
45 int32_t byteRate;
46 int16_t blockAlign;
48};
49
50}
51
52#endif
static bool ReadWav(std::string_view path_name, PCM &pcm)
static bool ReadMp3(std::string_view path_name, PCM &pcm)
static bool ReadFlac(std::string_view path_name, PCM &pcm)
static bool ReadOgg(std::string_view path_name, PCM &pcm)
表示一段内存
std::vector< std::byte > Buffer