a71de2a7bf
+ Fixed warnings in SPC code in 64-bit mode
36 lines
616 B
C++
36 lines
616 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);
|
|
_audioDevice->ProcessEndOfFrame();
|
|
}
|
|
}
|