{
get { return this._SampleSource.Length; }
}
-
public double 長さsec
{
get { return this._SampleToSec( this.長さsample ); }
get { return this._SampleSource.Position; }
set { this._SampleSource.Position = value; }
}
-
public double 位置sec
{
get
}
}
- public WaveFormat WaveFormat
- {
- get { return this._SampleSource.WaveFormat; }
- }
-
public CSCore.ISampleSource SampleSource
{
get { return this._SampleSource; }
}
+ public CSCore.IWaveSource WaveSource
+ {
+ get { return this._WaveSource; }
+ }
/// <summary>
/// 音量。0.0(無音)~1.0(原音)。
private long _SecToSample( double 時間sec )
{
- long 時間sample = (long) ( 時間sec * this.WaveFormat.SampleRate * this.WaveFormat.Channels + 0.5 ); // +0.5 は四捨五入
- 時間sample -= ( 時間sample % this.WaveFormat.Channels ); // チャンネル数の倍数にする。
+ var wf = this.SampleSource.WaveFormat;
+
+ long 時間sample = (long) ( 時間sec * wf.SampleRate * wf.Channels + 0.5 ); // +0.5 は四捨五入
+ 時間sample -= ( 時間sample % wf.Channels ); // チャンネル数の倍数にする。
return 時間sample;
}
private double _SampleToSec( long 時間sample )
{
- return 時間sample / ( this.WaveFormat.Channels * this.WaveFormat.SampleRate );
+ var wf = this.SampleSource.WaveFormat;
+
+ return 時間sample / ( wf.Channels * wf.SampleRate );
}
}
}