Mesen-SX/Core/SoundMixer.cpp
Sour bdc57286e7 SPC: Integrate blargg's SPC emulation library
Sound still doesn't work, however.
2019-02-16 11:23:01 -05:00

35 lines
579 B
C++

#include "stdafx.h"
#include "SoundMixer.h"
SoundMixer::SoundMixer()
{
_audioDevice = nullptr;
_sampleRate = 32000;
}
SoundMixer::~SoundMixer()
{
}
void SoundMixer::RegisterAudioDevice(IAudioDevice *audioDevice)
{
_audioDevice = audioDevice;
}
void SoundMixer::StopAudio(bool clearBuffer)
{
if(_audioDevice) {
if(clearBuffer) {
_audioDevice->Stop();
} else {
_audioDevice->Pause();
}
}
}
void SoundMixer::PlayAudioBuffer(int16_t* samples, uint32_t sampleCount)
{
if(_audioDevice) {
_audioDevice->PlayBuffer(samples, sampleCount, _sampleRate, true);
}
}