public ProvidePenAudioFile ( |
||
cancellationToken | ||
mp3SourceFile | string | |
Résultat | Task |
void PrepareInputFiles(CancellationToken cancellationToken) { packageDirectoryStructure.Package.ConfirmationSound = converter.ProvidePenAudioFile(cancellationToken, Path.Combine(PathUtil.GetDirectory(), "media", "ding.ogg")).Result; // prepare input files Parallel.ForEach( packageDirectoryStructure.Package.Tracks, new ParallelOptions { CancellationToken = cancellationToken, MaxDegreeOfParallelism = System.Environment.ProcessorCount }, i => { i.PenAudioFile = converter.ProvidePenAudioFile(cancellationToken, i.Path).Result; }); }
public void TestConvert(string source) { var cacheDir = TestFile("media-cache"); PathUtil.EnsureNotExists(cacheDir); PathUtil.EnsureDirectoryExists(cacheDir); var converter = new MediaFileConverter(cacheDir); var convertedFile = converter.ProvidePenAudioFile(CancellationToken.None, source).Result; }