CRI ADX  Last Updated: 2024-03-21 14:32 p
バイノーラル再生

サンプルのディレクトリ

/cri/pc/samples/criatomex/playback_with_binauralization

サンプルで使用しているデータ

/cri/common/smpdata/criatomex/
  • Binaural_project.acf
  • Binaural_cue.acb

サンプルの解説

多チャンネル音声素材をバイノーラル化して再生するサンプルです。

バイノーラル処理を使用するためにはライブラリ初期化時に指定する CriAtomExAsrConfig 構造体のサウンドレンダラタイプ ( CriAtomExAsrConfig::sound_renderer_type ) に CRIATOM_SOUND_RENDERER_SPATIAL を指定します。
実際にサウンドレンダラタイプを指定してライブラリを初期化しているコードを以下に示します。

/* バイノーラル処理を使用する場合はサウンドレンダラタイプをスペシャルに設定 */
asr_config.sound_renderer_type = CRIATOM_SOUND_RENDERER_SPATIAL;
/* ライブラリの初期化 */
smputl_initialize_for_spatialaudio(&ex_config, &asr_config, NULL, 0);
@ CRIATOM_SOUND_RENDERER_SPATIAL
Definition: cri_atom.h:858

ライブラリの初期化後、 criAtomExAsr_EnableBinauralizer 関数を実行することでバイノーラル処理の有効・無効を切り替えることができます。
また、 criAtomExAsr_IsEnabledBinauralizer 関数によりバイノーラル処理の有効・無効を確認することができます。
実際にバイノーラルの有効・無効を切り替えるコードを以下に示します。

/* バイノーラル処理の有効・無効を確認して切り替える */
CriBool is_binaural = criAtomExAsr_IsEnabledBinauralizer();
if (is_binaural == CRI_FALSE) {
is_binaural = CRI_TRUE;
} else {
is_binaural = CRI_FALSE;
}
CriBool criAtomExAsr_IsEnabledBinauralizer(void)
バイノーラライザーの有効化状態の取得
void criAtomExAsr_EnableBinauralizer(CriBool enabled)
バイノーラライザーの有効化