Recently, it seems to be working with the voice!
The second method of audio conversion, this method is more simple than the first way!
First, you need to download a "Ffmpeg.exe" plugin and put it in your project, such as:
The file is called in the program to help convert the audio format!
On the code:
usingSystem;usingSystem.Threading;usingSystem.IO;usingSystem.Diagnostics;usingsystem.security; Public Partial classcowala_201512chritmas_amrtest:system.web.ui.page{protected voidPage_Load (Objectsender, EventArgs e) {if(!IsPostBack) {changedplay.visible=false; } } protected voidFfmpeg_click (Objectsender, EventArgs e) { if(amrfileup.hasfile) {stringKey =Amrfileup.filename; stringSavepath = Server.MapPath ("~/upload/amr/") +key; Amrfileup.saveas (Savepath); stringMp3savepth = Server.MapPath ("~/upload/mp3/") + key. Split ('.')[0]. ToString () +". mp3"; if(!string. IsNullOrEmpty (CONVERTTOMP3 (Savepath, mp3savepth))) {changedplay.visible=true; CHANGEDPLAY.ATTRIBUTES.ADD ("src","upload/mp3/"+ key. Split ('.')[0]. ToString () +". mp3"); Response.Write ("<script>alert (' conversion succeeded! ');</script>"); } } } Public stringCONVERTTOMP3 (stringPathbefore,stringpathlater) { stringc = Server.MapPath ("/ffmpeg/") +@"ffmpeg.exe-i"+ Pathbefore +" "+Pathlater; stringstr =Runcmd (c); returnstr; } /// <summary> ///Execute cmd command/// </summary> Private stringRuncmd (stringc) {Try{ProcessStartInfo Info=NewProcessStartInfo ("Cmd.exe"); Info. Redirectstandardoutput=false; Info. UseShellExecute=false; Process P=Process.Start (info); P.startinfo.useshellexecute=false; P.startinfo.redirectstandardinput=true; P.startinfo.redirectstandardoutput=true; P.startinfo.redirectstandarderror=true; P.start (); P.standardinput.writeline (c); P.standardinput.autoflush=true; Thread.Sleep ( +); P.standardinput.writeline ("Exit"); p.WaitForExit (); stringOUTSTR =P.standardoutput.readtoend (); P.close (); returnoutstr; } Catch(Exception ex) {return "Error"+Ex. Message; } }}
Then come to Zhang:
OK, so simple, don't dare not to believe your eyes, is actually so simple!
Finally, a question: After you finish the hand, wipe, used to use the left or right hand?
Have any questions welcome into group harassment: 225443677 Don't be embarrassed!
tks!!!
. NET audio conversion. AMR turn. mp3 (FFmpeg conversion method)