Skip to content

Commit e5bf964

Browse files
committed
AudioService may have GetLengthInSeconds method as it may be helpful for various use-cases.
1 parent ba92e36 commit e5bf964

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/SoundFingerprinting/Audio/IAudioService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@ public interface IAudioService
2929
/// <param name="sampleRate">Target sample rate</param>
3030
/// <returns>Audio samples</returns>
3131
AudioSamples ReadMonoSamplesFromFile(string pathToSourceFile, int sampleRate);
32+
33+
/// <summary>
34+
/// Returns a usually accurate estimate for the length of the file
35+
/// </summary>
36+
/// <param name="pathToSourceFile">Path to audio source to get it's length from</param>
37+
/// <returns>Length in seconds</returns>
38+
float GetLengthInSeconds(string pathToSourceFile);
3239
}
3340
}

0 commit comments

Comments
 (0)