voxelcore/src/audio/NoAudio.cpp
2024-05-17 15:46:54 +03:00

22 lines
553 B
C++

#include "NoAudio.hpp"
using namespace audio;
NoSound::NoSound(std::shared_ptr<PCM> pcm, bool keepPCM) {
duration = pcm->getDuration();
if (keepPCM) {
this->pcm = pcm;
}
}
std::unique_ptr<Sound> NoAudio::createSound(std::shared_ptr<PCM> pcm, bool keepPCM) {
return std::make_unique<NoSound>(pcm, keepPCM);
}
std::unique_ptr<Stream> NoAudio::openStream(std::shared_ptr<PCMStream> stream, bool keepSource) {
return std::make_unique<NoStream>(stream, keepSource);
}
NoAudio* NoAudio::create() {
return new NoAudio();
}