Implement IAudioSource.Duration property and IAudioDecoderSettings.Open extension method.

This commit is contained in:
Grigory Chudov
2018-04-07 23:02:01 -04:00
parent be881945ac
commit deb3448a55
27 changed files with 817 additions and 75 deletions

View File

@@ -127,6 +127,11 @@ namespace TTA {
}
}
virtual property TimeSpan Duration {
TimeSpan get() {
return Length < 0 ? TimeSpan::Zero : TimeSpan::FromSeconds((double)Length / PCM->SampleRate);
}
}
virtual property Int64 Length {
Int64 get() {
return _sampleCount;