feat(音频): 添加从NPK加载音频文件的功能
实现SoundPackArchive系统用于管理NPK格式的音频资源包 为Music和Sound类添加loadFromNpk方法支持从NPK加载音频 新增音频播放控制功能如暂停、恢复、停止等
This commit is contained in:
@@ -17,6 +17,7 @@ class Music : public RefObject {
|
||||
public:
|
||||
static Ptr<Music> loadFromFile(const std::string& path);
|
||||
static Ptr<Music> loadFromMemory(const uint8* data, size_t size);
|
||||
static Ptr<Music> loadFromNpk(const std::string& audioPath);
|
||||
|
||||
~Music();
|
||||
|
||||
@@ -37,9 +38,11 @@ public:
|
||||
|
||||
private:
|
||||
Music(Mix_Music* music, const std::string& path = "");
|
||||
Music(Mix_Music* music, std::vector<uint8> data, const std::string& path = "");
|
||||
|
||||
Mix_Music* music_ = nullptr;
|
||||
std::string path_;
|
||||
std::vector<uint8> data_;
|
||||
float volume_ = 1.0f;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user