MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / DSGetSoundBuffer

Function DSGetSoundBuffer

source/SoundCore.cpp:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149//-----------------------------------------------------------------------------
150
151HRESULT DSGetSoundBuffer(VOICE* pVoice, uint32_t dwBufferSize, uint32_t nSampleRate, int nChannels, const char* pszVoiceName)
152{
153 pVoice->name = pszVoiceName;
154
155 std::shared_ptr<SoundBuffer> soundBuffer = GetFrame().CreateSoundBuffer(dwBufferSize, nSampleRate, nChannels, pszVoiceName);
156 if (!soundBuffer)
157 return E_FAIL;
158
159 pVoice->lpDSBvoice = soundBuffer;
160
161 _ASSERT(g_uNumVoices < uMAX_VOICES);
162 if(g_uNumVoices < uMAX_VOICES)
163 g_pVoices[g_uNumVoices++] = pVoice;
164
165 if(pVoice->bIsSpeaker)
166 g_pSpeakerVoice = pVoice;
167
168 return DS_OK;
169}
170
171void DSReleaseSoundBuffer(VOICE* pVoice)
172{

Callers 3

InitMethod · 0.85
Spkr_DSInitFunction · 0.85
InitMethod · 0.85

Calls 1

CreateSoundBufferMethod · 0.80

Tested by

no test coverage detected