} // -- private void btn_untak_pcm_Click(object sender, EventArgs e) { if (SELECTED_FILES == null) { return; } string INPUT = SELECTED_FILES[0]; string OUTPUT = Path.ChangeExtension(INPUT, ".pcm"); var ffmp = new FFmpeg(prog.CDCRUSH.FFMPEG_PATH); var tak = new Tak(prog.CDCRUSH.TOOLS_PATH); tak.onComplete = (s) => { LOG.log($"TAK Operation Complete - {s}"); }; ffmp.onComplete = (s) => { LOG.log($"FFMPEG Operation Complete - {s}"); }; tak.decodeToStream(INPUT, (_out) => { ffmp.convertWavStreamToPCM(OUTPUT, (_in) => { _out.CopyTo(_in); _in.Close(); }); }); } // --
}// ----------------------------------------- // -- public override void start() { base.start(); p = (RestoreParams)jobData; INPUT = Path.Combine(p.tempDir, track.storedFileName); OUTPUT = Path.Combine(p.tempDir, track.getFilenameRaw()); track.workingFile = OUTPUT; // Point to the new file // - var fileExt = Path.GetExtension(track.storedFileName); requirePostSizeFix = AudioMaster.isLossyByExt(fileExt); // -- if (track.isData) { var ecm = new EcmTools(CDCRUSH.TOOLS_PATH); setupHandlers(ecm); ecm.unecm(INPUT); } else { // No need to convert back, end the task if (p.mode == 2) { // Point to correct file track.workingFile = INPUT; complete(); return; } var ffmp = new FFmpeg(CDCRUSH.FFMPEG_PATH); if (fileExt.ToLower() == ".tak") { var tak = new Tak(CDCRUSH.TOOLS_PATH); setupHandlers(tak); tak.decodeToStream(INPUT, (_out) => { ffmp.convertWavStreamToPCM(OUTPUT, (_in) => { _out.CopyTo(_in); _in.Close(); }); }); } else { setupHandlers(ffmp); ffmp.audioToPCM(INPUT, track.workingFile); } } log("Restoring track -" + track.storedFileName); }// -----------------------------------------