當前位置: 首頁>>代碼示例>>C#>>正文


C# Mp3FileReader.ToSampleProvider方法代碼示例

本文整理匯總了C#中NAudio.Wave.Mp3FileReader.ToSampleProvider方法的典型用法代碼示例。如果您正苦於以下問題:C# Mp3FileReader.ToSampleProvider方法的具體用法?C# Mp3FileReader.ToSampleProvider怎麽用?C# Mp3FileReader.ToSampleProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NAudio.Wave.Mp3FileReader的用法示例。


在下文中一共展示了Mp3FileReader.ToSampleProvider方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CombineAudioSignal

 /// <summary>
 ///     Takes 1 wave file, Takes 1 Mp3 File and Combines the two files and resaves on top of the wav.
 /// </summary>
 /// <returns></returns>
 public string CombineAudioSignal()
 {
     var audioPath = _file.Remove(0, _file.IndexOf("Uploads"));
     var server = HttpContext.Current.Server;
     var directoryInfoBeats =
         new DirectoryInfo(new ResourceProvider().GetPath(RapResource.Beats));
     var sortedFiles = from f in directoryInfoBeats.EnumerateFiles() orderby f.CreationTime select f;
     var beats = sortedFiles.Select(item => item.FullName).ToList();
     using (var recordedAudio = new WaveFileReader(server.MapPath("~/" + audioPath)))
     using (var instrumental = new Mp3FileReader(beats[_beatLocation]))
     {
         var inputs = new List<ISampleProvider>
         {
             recordedAudio.ToSampleProvider(),
             instrumental.ToSampleProvider(),
         };
         var mixer = new MixingSampleProvider(inputs);
         //requires work to avoid overriding the file being used
         WaveFileWriter.CreateWaveFile16(
             new ResourceProvider().GetPath(RapResource.RapBattleAudio) + new Guid() + ".wav", mixer);
     }
     return _file;
 }
開發者ID:asebak,項目名稱:rapbattleonline,代碼行數:27,代碼來源:RapSignalProcessing.cs

示例2: ReadMp3File

 private static ISampleProvider ReadMp3File(Mp3FileReader reader, CompositeDisposable disposables)
 {
     disposables.Add(reader);
     return reader.ToSampleProvider();
 }
開發者ID:Kei-Nanigashi,項目名稱:StarryEyes,代碼行數:5,代碼來源:AudioPlayer.cs


注:本文中的NAudio.Wave.Mp3FileReader.ToSampleProvider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。