public void ProcessSingleTempoJob(string sourceFileName, float?tempo = null, float?pitch = null) { TempoDelta = tempo; PitchDelta = pitch; XMusicLogger.Init(); GenerateWorkFlow(sourceFileName); using (xConverter = new XConverter()) using (xTempoProcessor = new XTempoProcessor()) { Process(); } RemoveTempFiles(); XMusicLogger.AddLog($"Finished !!"); }
public void ProcessTempoJob(XJob job) { using (var xConverter = new XConverter()) using (var xTempoProcessor = new XTempoProcessor()) { job.StartTime = DateTime.Now; if (job.SourceFileType == XFileType.Wma) { XJobResult res = xConverter.Convert(job.SourceFileName, XFileType.Mp3); SaveTempFile(res.TempFileName, res.OutputData); ProccessMp3(xConverter, xTempoProcessor, res.TempFileName, job.SourceFileName); } if (job.SourceFileType == XFileType.Mp3) { ProccessMp3(xConverter, xTempoProcessor, job.SourceFileName, job.SourceFileName); } job.EndTime = DateTime.Now; } }
private void ProccessMp3(XConverter xConverter, XTempoProcessor xTempoProcessor, string mp3Path, string mainSourceFileName) { XJobResult res = xConverter.Convert(mp3Path, XFileType.Wav); SaveTempFile(res.TempFileName, res.OutputData); var wavTempoJob = new XTempoJob { SourceFileName = res.TempFileName, ReturnData = true }; xTempoProcessor.Process(wavTempoJob); //var afterTempoWavToMp3Job = new XConvertJob { SourceData = wavTempoJob.OutputData, DestinationFileType = XFileType.Mp3 }; SaveTempFile(mainSourceFileName.GenerateGuidPath(XFileType.Mp3), wavTempoJob.OutputData); //xConverter.Convert(mp3ToWavJob); //if (afterTempoWavToMp3Job.SourceData != null) //{ // File.WriteAllBytes(afterTempoWavToMp3Job.SourceFileName, afterTempoWavToMp3Job.SourceData); //} }