| 149 | //----------------------------------------------------------------------------- |
| 150 | |
| 151 | HRESULT 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 | |
| 171 | void DSReleaseSoundBuffer(VOICE* pVoice) |
| 172 | { |
no test coverage detected