OSDN Git Service

微修正。
authorくまかみ工房 <kumakamikoubou@gmail.com>
Sat, 14 Oct 2017 15:26:19 +0000 (00:26 +0900)
committerくまかみ工房 <kumakamikoubou@gmail.com>
Sat, 14 Oct 2017 15:26:19 +0000 (00:26 +0900)
FDK/メディア/サウンド/WASAPI/SampleSourceFactory.cs
FDK/メディア/サウンド/WASAPI/SoundDevice.cs

index de97355..56dcdf3 100644 (file)
@@ -39,7 +39,7 @@ namespace FDK.メディア.サウンド.WASAPI
                        //----------------
                        try
                        {
-                               // todo: 実装する
+                               // 対応できるフォーマットは MediaFoundation とダブるので、こちらの実装は不要かも。
                                //return new CSCoreSampleSource( path );
                        }
                        catch
index 871edc2..e0dd949 100644 (file)
@@ -109,24 +109,24 @@ namespace FDK.メディア.サウンド.WASAPI
                                                        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 );
 
@@ -136,9 +136,6 @@ namespace FDK.メディア.サウンド.WASAPI
 
                                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" :