Skip to content

Commit

Permalink
account for difference with sampling rate in player.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikiriao committed Jan 26, 2025
1 parent 70dc8a2 commit 7a2e384
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/srla_player/srla_player_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ void SRLAPlayer_Initialize(const struct SRLAPlayerConfig* config)

/* 出力フォーマットが対応しているかチェック */
{
WAVEFORMATEX closest_format, *pformat;
pformat = &closest_format;
WAVEFORMATEX *pformat;
hr = IAudioClient_IsFormatSupported(audio_client, AUDCLNT_SHAREMODE_SHARED, &format, &pformat);
if (hr != S_OK) {
fprintf(stderr, "Unsupported format for WASAPI Playback. \n");
exit(1);
/* レートは変換できるがそれ以外のフォーマットの差異は対応していないためエラー終了 */
if ((format.nSamplesPerSec == pformat->nSamplesPerSec) || (format.nChannels != pformat->nChannels)) {
fprintf(stderr, "Unsupported format for WASAPI Playback. \n");
exit(1);
}
}
}

Expand Down

0 comments on commit 7a2e384

Please sign in to comment.