diff options
| author | magumagu <magumagu9@gmail.com> | 2014-03-27 17:56:05 -0700 |
|---|---|---|
| committer | magumagu <magumagu9@gmail.com> | 2014-03-29 11:19:32 -0700 |
| commit | 3afa17f752a06c438d912c85519d3edb34023447 (patch) | |
| tree | eedb000a8b56e7afc19399da73938cddd6a02dfa /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | 78499e5b7c96362bd86a8b1599707be1c983fde5 (diff) | |
Move audio handling out of DSP emulation.
This is good for a couple of reasons: one, it gets rid of duplicated code,
and two, DSP emulation shouldn't need to interact with audio in the first
place.
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index 07da747c1e..c2fd936974 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -159,4 +159,25 @@ namespace AudioCommon soundStream->SetVolume(SConfig::GetInstance().m_Volume); } } + + void ClearAudioBuffer(bool mute) + { + if (soundStream) + soundStream->Clear(mute); + } + + void SendAIBuffer(short *samples, unsigned int num_samples) + { + if (!soundStream) + return; + + CMixer* pMixer = soundStream->GetMixer(); + + if (pMixer && samples) + { + pMixer->PushSamples(samples, num_samples); + } + + soundStream->Update(); + } } |
