ProvidePenAudioFile() публичный Метод

public ProvidePenAudioFile ( CancellationToken cancellationToken, string mp3SourceFile ) : Task
cancellationToken System.Threading.CancellationToken
mp3SourceFile string
Результат Task
Пример #1
0
 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;
     });
 }
Пример #2
0
 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;
 }