Lines Matching defs:wfx

329 static int waveformat_from_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
331 memset (wfx, 0, sizeof (*wfx));
333 wfx->wFormatTag = WAVE_FORMAT_PCM;
334 wfx->nChannels = as->nchannels;
335 wfx->nSamplesPerSec = as->freq;
336 wfx->nAvgBytesPerSec = as->freq << (as->nchannels == 2);
337 wfx->nBlockAlign = 1 << (as->nchannels == 2);
338 wfx->cbSize = 0;
343 wfx->wBitsPerSample = 8;
348 wfx->wBitsPerSample = 16;
349 wfx->nAvgBytesPerSec <<= 1;
350 wfx->nBlockAlign <<= 1;
355 wfx->wBitsPerSample = 32;
356 wfx->nAvgBytesPerSec <<= 2;
357 wfx->nBlockAlign <<= 2;
368 static int waveformat_to_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
370 if (wfx->wFormatTag != WAVE_FORMAT_PCM) {
372 wfx->wFormatTag);
376 if (!wfx->nSamplesPerSec) {
380 as->freq = wfx->nSamplesPerSec;
382 switch (wfx->nChannels) {
394 wfx->nChannels
399 switch (wfx->wBitsPerSample) {
415 wfx->wBitsPerSample);
500 WAVEFORMATEX wfx;
518 err = waveformat_from_audio_settings (&wfx, &ds->as);
530 bd.lpwfxFormat = &wfx;
542 hr = IDirectSoundBuffer_GetFormat (ds->dsound_buffer, &wfx, sizeof (wfx), NULL);
565 wfx.wFormatTag,
566 wfx.nChannels,
567 wfx.nSamplesPerSec,
568 wfx.nAvgBytesPerSec,
569 wfx.nBlockAlign,
570 wfx.wBitsPerSample,
571 wfx.cbSize));
754 WAVEFORMATEX wfx;
773 err = waveformat_from_audio_settings (&wfx, &ds->as);
785 bd.lpwfxFormat = &wfx;
804 memset (&wfx, 0, sizeof (wfx));
805 hr = IDirectSoundCaptureBuffer_GetFormat (ds->dsound_capture_buffer, &wfx, sizeof (wfx), NULL);
828 wfx.wFormatTag,
829 wfx.nChannels,
830 wfx.nSamplesPerSec,
831 wfx.nAvgBytesPerSec,
832 wfx.nBlockAlign,
833 wfx.wBitsPerSample,
834 wfx.cbSize));