我有 SoundBuffer。我希望这个缓冲区移动到音乐。现在我保存在文件中并读出,但我不想保存。我能做些什么?现在我有这个代码:
sf::SoundBuffer sb = getSoundBuffer(new_channels,sample_rate);
sb.saveToFile("sound.wav");
std::unique_ptr<sf::Music> Buffer(new sf::Music());
Buffer->openFromFile("sound.wav")
musicAlias[alias] = std::move(Buffer);
...
music->selected = musicAlias[alias].get();