/** * <summary>Wave ボイスプールの作成</summary> * <param name="numVoices">ボイス数</param> * <param name="maxChannels">最大チャンネル数</param> * <param name="maxSamplingRate">最大サンプリングレート</param> * <param name="streamingFlag">ストリーミング再生フラグ</param> * <param name="identifier">ボイスプール識別子</param> * <returns>Wave ボイスプール</returns> * 本関数を実行することで、Wave 再生が可能なボイスがプールされます。<br> * AtomEx プレーヤで Wave データ(もしくは Wave データを含むキュー)の再生を行うと、 * AtomEx プレーヤは作成された Wave ボイスプールからボイスを取得し、再生を行います。<br> * 再生終了後は、必ず、Dispose 関数でオブジェクトを破棄してください。<br> * 特定の CriAtomExPlayer に対して、作成したボイスプールからボイスを取得するように明示的に設定したい場合は、 * identifier としてデフォルトの 0 以外の値を指定して作成し、 CriAtomExPlayer::SetVoicePoolIdentifier 関数を * 呼び出してください。 * \sa CriAtomExPlayer::SetVoicePoolIdentifier */ public CriAtomExWaveVoicePool(int numVoices, int maxChannels, int maxSamplingRate, bool streamingFlag, uint identifier = 0) { this._identifier = identifier; this._identifier = identifier; this._numVoices = numVoices; this._maxChannels = maxChannels; this._maxSamplingRate = maxSamplingRate; VoicePoolConfig config = new VoicePoolConfig(); config.identifier = identifier; config.numVoices = numVoices; config.playerConfig.maxChannels = maxChannels; config.playerConfig.maxSamplingRate = maxSamplingRate; config.playerConfig.streamingFlag = streamingFlag; config.playerConfig.soundRendererType = (int)CriAtomEx.SoundRendererType.Asr; config.playerConfig.decodeLatency = 0; this._handle = criAtomExVoicePool_AllocateWaveVoicePool(ref config, IntPtr.Zero, 0); if (this._handle == IntPtr.Zero) { throw new Exception("CriAtomExWaveVoicePool() failed."); } CriDisposableObjectManager.Register(this, CriDisposableObjectManager.ModuleType.Atom); }
private static IntPtr criAtomExVoicePool_AllocateWaveVoicePool(ref VoicePoolConfig config, IntPtr work, int work_size) { return(new IntPtr(1)); }
private static extern IntPtr criAtomExVoicePool_AllocateWaveVoicePool(ref VoicePoolConfig config, IntPtr work, int work_size);