Пример #1
0
        private string CreateMp3File(string filepath, PodcastPost podcastPost)
        {
            if (filepath.EndsWith(".mp3"))
            {
                Console.WriteLine("Supplied audio file is MP3 file so skipping MP3 generation");
                return(filepath);
            }

            //must be a WAV file, so create the MP3
            Console.Write("Generating MP3 file - please be patient... ");
            try
            {
                string mp3Filepath = _podcastService.GenerateMp3File(filepath, podcastPost);
                Console.WriteLine("Success!");
                return(mp3Filepath);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Failed with error:");
                Console.WriteLine(ex.Message);
                throw;
            }
        }