. NET voice, video and other format conversions

Source: Internet
Author: User

Recently in the development of public numbers encountered a problem, that is, received the voice message format AMR, on the Web page usually can not play directly, need to first to MP3, so found a way, Using Ffmpeg.exe, online can search the use of ffmpeg.exe, including a variety of voice, video conversion, The following is an example of AMR to MP3 in. NET for your reference, did not tidy up, directly copy the code in the project, call the ConvertAmrToMp3 method, to achieve more conversions please modify the command to

<summary>///convert AMR audio to MP3///</summary>/<param name= "fileName" > File path before conversion &lt ;/param>//<param name= "Targetfilname" > converted file path </param> public static void ConvertAmrToMp3 ( String fileName, String targetfilname) {startprocess (AppDomain.CurrentDomain.BaseDirectory + @ "\ffmpeg. EXE ", String.            Format ("-i \" {0}\ "\" {1}\ "", FileName, Targetfilname)); Compress MP3//startprocess (AppDomain.CurrentDomain.BaseDirectory + @ "\ffmpeg.exe", String.        Format (@ "-i {0}-ac 1-ar 8000-ab 7950-y {1}", FileName, Targetfilname)); }//performs a conversion to private static void StartProcess (String fileName, String args) {process process                = Process.Start (new ProcessStartInfo {filename = filename, Arguments = args,  UseShellExecute = False, Redirectstandardinput = false, Redirectstandardoutput = False                CreateNoWindow = true}); Process.            WaitForExit (); Process.        Close (); }

  

. NET voice, video and other format conversions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.