CRI ADX  Last Updated: 2024-07-17 10:48 p
更改参数播放

示例目录

/cri/pc/samples/criatomex/playback_param


示例描述

CRI Atom可以在播放音频时更改Player参数,如音量、播放音高、滤波器的截止频率。


在Player开始播放前或播放期间都可以更改各种参数。
可以使用各个专用的参数设置函数为Player设置参数, 但要实际反映到Player的话,必须“对Player执行::criAtomExPlayer_UpdateAll函数”。
设置Player参数,执行低通滤波器的代码如下。
/* 设置音量 */
/* 用音分设置音高 */
criAtomExPlayer_SetPitch(player, 0.0f);
/* 设置带通滤波器的截止频率 */
/* 设置双二阶滤波器的参数 */
/* 将参数反映到Player使用的所有Voice */
@ CRIATOMEX_BIQUAD_FILTER_TYPE_LOWPASS
Definition: cri_le_atom_ex.h:1988
void criAtomExPlayer_SetPitch(CriAtomExPlayerHn player, CriFloat32 pitch)
Set the pitch (detune)
void criAtomExPlayer_SetVolume(CriAtomExPlayerHn player, CriFloat32 volume)
Set the volume
CriAtomExPlayerObj * CriAtomExPlayerHn
Player handle
Definition: cri_le_atom_ex.h:3622
void criAtomExPlayer_UpdateAll(CriAtomExPlayerHn player)
Update the playback parameters (for all sounds currently playing)
void criAtomExPlayer_SetBiquadFilterParameters(CriAtomExPlayerHn player, CriAtomExBiquadFilterType type, CriFloat32 frequency, CriFloat32 gain, CriFloat32 q_value)
Set the biquad filter parameters
void criAtomExPlayer_SetBandpassFilterParameters(CriAtomExPlayerHn player, CriFloat32 cof_low, CriFloat32 cof_high)
Set the band pass filter parameters


示例使用的数据中Atom Craft项目的目录

/cri/tools/criatomex/examples/tutorial_data_for_runtime