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

Function SpkrInitialize

source/Speaker.cpp:260–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258//=============================================================================
259
260void SpkrInitialize()
261{
262 if (g_bDisableDirectSound)
263 {
264 SpeakerVoice.bMute = true;
265 LogFileOutput("SpkrInitialize: g_bDisableDirectSound=1... SpeakerVoice.bMute=true\n");
266 }
267 else
268 {
269 g_bSpkrAvailable = Spkr_DSInit();
270 LogFileOutput("Spkr_DSInit(), res=%d\n", g_bSpkrAvailable ? 1 : 0);
271 if (!g_bSpkrAvailable)
272 {
273 GetFrame().FrameMessageBox(
274 "The emulator is unable to initialize a waveform "
275 "output device. Make sure you have a sound card "
276 "and a driver installed and that Windows is "
277 "correctly configured to use the driver. Also "
278 "ensure that no other program is currently using "
279 "the device.",
280 "Configuration",
281 MB_ICONEXCLAMATION | MB_SETFOREGROUND);
282 }
283 }
284
285 //
286
287 InitRemainderBuffer();
288
289 g_pSpeakerBuffer = new short[SPKR_SAMPLE_RATE * g_nSPKR_NumChannels]; // Buffer can hold a max of 1 seconds worth of samples
290}
291
292//=============================================================================
293

Callers 1

WndProcMethod · 0.85

Calls 4

LogFileOutputFunction · 0.85
Spkr_DSInitFunction · 0.85
InitRemainderBufferFunction · 0.85
FrameMessageBoxMethod · 0.80

Tested by

no test coverage detected