void main()
{
rawpcm_vpconfig.identifier = RAW_PCM_VOICE_POOL_ID;
rawpcm_vpconfig.num_voices = 1;
rawpcm_vpconfig.player_config.max_channels = 1;
raw]pcm_vpconfig.player_config.max_sampling_rate = PCM_SAMPLING_RATE;
rawpcm_vpconfig.player_config.pcm_format = CRIATOM_PCM_FORMAT_SINT16;
&rawpcm_vpconfig, NULL, 0);
memset(app_obj->pcm_buffer[0], 0, PCM_BUFFER_LENGTH * sizeof(CriSint16));
app_obj->sin_offset = 0.0f;
app_obj->pcm_buffer_current = 0;
app_obj->pcm_buffer[0], PCM_BUFFER_LENGTH * sizeof(CriSint16));
}
static void app_data_request_func(
{
AppObj *app_obj = (AppObj*)obj;
CriFloat32 sin_offset = app_obj->sin_offset;
CriFloat32 sin_step = 2.0f * 3.141592f * app_obj->sin_frequency / PCM_SAMPLING_RATE;
app_obj->pcm_buffer_current++;
app_obj->pcm_buffer_current %= 2;
CriSint16 *buffer = app_obj->pcm_buffer[app_obj->pcm_buffer_current];
for (i = 0; i < PCM_BUFFER_LENGTH; i++) {
buffer[i] = (CriSint16)(sinf(sin_offset) * 32767.0f);
sin_offset += sin_step;
}
app_obj->sin_offset = fmodf(sin_offset, 2.0f * 3.141592f);
}
void criAtomExPlayer_SetVoicePoolIdentifier(CriAtomExPlayerHn player, CriAtomExVoicePoolIdentifier identifier)
ボイスプール識別子の指定
void criAtomExPlayer_SetData(CriAtomExPlayerHn player, void *buffer, CriSint32 size)
音声データのセット(オンメモリデータの指定)
void criAtomExPlayer_SetFormat(CriAtomExPlayerHn player, CriAtomExFormat format)
フォーマットの指定
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
再生の開始
void criAtomExPlayer_SetDataRequestCallback(CriAtomExPlayerHn player, CriAtomExPlayerDataRequestCbFunc func, void *obj)
データ要求コールバック関数の登録
CriUint32 CriAtomExPlaybackId
再生ID
Definition: cri_le_atom_ex.h:3728
void criAtomExPlayer_SetNumChannels(CriAtomExPlayerHn player, CriSint32 num_channels)
チャンネル数の指定
void criAtomExPlayer_SetSamplingRate(CriAtomExPlayerHn player, CriSint32 sampling_rate)
サンプリングレートの指定
#define criAtomExVoicePool_SetDefaultConfigForRawPcmVoicePool(p_config)
RawPCMボイスプール作成用コンフィグ構造体にデフォルト値をセット
Definition: cri_le_atom_ex.h:675
CriAtomExVoicePoolHn criAtomExVoicePool_AllocateRawPcmVoicePool(const CriAtomExRawPcmVoicePoolConfig *config, void *work, CriSint32 work_size)
RawPCMボイスプールの作成
struct CriAtomPlayerTag * CriAtomPlayerHn
Atomプレーヤーハンドル
Definition: cri_le_atom.h:2345
void criAtomPlayer_SetData(CriAtomPlayerHn player, void *buffer, CriSint32 buffer_size)
音声データのセット(オンメモリデータの指定)