public string CreateTempWavFile(string audioFilePath, string tempFolderName = "") { var newFile = Path.Combine(Path.GetTempPath() + tempFolderName, Path.GetFileNameWithoutExtension(audioFilePath)) + ".wav"; //create directory if it doesn't exist var dir = Path.GetDirectoryName(newFile); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } _audio.ConvertToWav(newFile); return(newFile); }