if( e.ErrorCode == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED )
{
int サイズframe = this._AudioClient.GetBufferSize(); // アライメント済みサイズが取得できる。
- long 期間100ns = FDKUtilities.変換_sec単位から100ns単位へ( (double) サイズframe / this._WaveFormat.SampleRate );
+ this.遅延sec = (double) サイズframe / this._WaveFormat.SampleRate;
+ long 期間100ns = FDKUtilities.変換_sec単位から100ns単位へ( this.遅延sec );
_AudioClientを初期化する( 期間100ns ); // 再度初期化。それでも例外なら知らん。
}
}
// デバイスの遅延を取得。
- int バッファのフレーム数 = this._AudioClient.GetBufferSize();
- this.遅延sec = (double) バッファのフレーム数 / this._WaveFormat.SampleRate; // 例: 1056[frames] ÷ 48000[frames/sec] = 0.022[sec]
+ //int バッファのフレーム数 = this._AudioClient.GetBufferSize();
+ //this.遅延sec = (double) バッファのフレーム数 / this._WaveFormat.SampleRate; // 例: 1056[frames] ÷ 48000[frames/sec] = 0.022[sec]
+ // --> 取得しなくても、自分が指定した 期間100ns が採用されている。
// イベント駆動に使うイベントを生成し、AudioClient へ登録する。
this._レンダリングイベント = new EventWaitHandle( false, EventResetMode.AutoReset );