this.再生遅延sec = (double) サイズframe / this._WaveFormat.SampleRate;
long 期間100ns = FDKUtilities.変換_sec単位から100ns単位へ( this.再生遅延sec );
- this._AudioClientを初期化する( 期間100ns ); // 再度初期化。それでも例外なら知らん。
+ this._AudioClientを初期化する( 期間100ns ); // 再度初期化。
}
else
{
- throw;
+ throw; // それでも例外なら知らん。
}
}
// デバイスの遅延を取得。
//int バッファのフレーム数 = this._AudioClient.GetBufferSize();
//this.再生遅延sec = (double) バッファのフレーム数 / this._WaveFormat.SampleRate; // 例: 1056[frames] ÷ 48000[frames/sec] = 0.022[sec]
- // --> 取得しなくても、自分が指定した 期間100ns が採用されている。
+ // --> ここで取得しなくても、初期化時に自分が指定した 期間100ns が採用されている。はず。
// イベント駆動に使うイベントを生成し、AudioClient へ登録する。
this._レンダリングイベント = new EventWaitHandle( false, EventResetMode.AutoReset );
this._AudioClient.SetEventHandle( this._レンダリングイベント.SafeWaitHandle.DangerousGetHandle() );
- // その他の WASAPI インターフェースを取得する。
+ // その他のインターフェースを取得する。
this._AudioRenderClient = AudioRenderClient.FromAudioClient( this._AudioClient );
this._AudioClock = AudioClock.FromAudioClient( this._AudioClient );
this.レンダリングを開始する();
- // todo: 追加のコーデックを登録。
- //CodecFactory.Instance.Register( "ogg-vorbis", new CodecFactoryEntry( ( s ) => new NVorbisSampleSource( s ).ToWaveSource(), ".ogg" ) );
-
// 完了。
var format = ( this.WaveFormat is WaveFormatExtensible wfx ) ?
$"{wfx.WaveFormatTag}[{AudioSubTypes.EncodingFromSubType( wfx.SubFormat )}], {wfx.SampleRate}Hz, {wfx.Channels}ch, {wfx.BitsPerSample}bits" :