载入中...
搜索中...
未找到
SoundData.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Resource.h"
6
7#include <cstddef>
8#include <cstdint>
9#include <vector>
10
11namespace eve {
12namespace sound {
13
16public:
18 SoundData(std::vector<uint8_t> pcm, int sampleRate, int bitDepth, int channels);
20 ~SoundData() override;
21
23 void adopt(eve::Resource &replacement) override;
24
26 int getSampleCount() const;
28 int getSampleRate() const;
30 int getBitDepth() const;
32 int getChannelCount() const;
34 double getDuration() const;
36 void *getData() const;
38 size_t getSize() const;
39
40private:
41 std::vector<uint8_t> pcm;
42 int sampleRate = 0;
43 int bitDepth = 0;
44 int channels = 0;
45};
46
47} // namespace sound
48} // namespace eve
std::map< std::string, std::vector< Key >, std::less<> > channels
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Resource is a game object that is managed by the ResourceManager. It can be loaded from a file or gen...
Definition Resource.h:51
Raw PCM audio buffer with format metadata (samples/rate/bit depth/channels).
Definition SoundData.h:15
~SoundData() override
Sound data.
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16