0

オーディオ変換にはffmpegを使用しています。録音したオーディオを mp3 形式に変換しようとしました。ファイルを取得しましたが、サイズが 0 です。誰でもこれを解決するのを手伝ってもらえますか?

これが私のコードです:

        Process ffmpegProcess;
        string strInputFile;
        string strOutputFile;
        strInputFile = Page.MapPath("audio.wav"); 
        strOutputFile = Page.MapPath("audio.mp3"); 
        ffmpegProcess = new Process();

        string fileargs = " -i ";
        fileargs += "\"" + strInputFile + "\"";
        fileargs += " \"" + strOutputFile + "\"";
        ffmpegProcess.StartInfo.Arguments = fileargs;
        ffmpegProcess.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
        ffmpegProcess.Start(); 
4

1 に答える 1

0

これを試して:

    Process ffmpegProcess;
    string strInputFile;
    string strOutputFile;
    strInputFile = Page.MapPath("audio.wav"); 
    strOutputFile = Page.MapPath("audio.mp3"); 
    ffmpegProcess = new Process();

    string fileargs = " -i ";
    fileargs += "\"" + strInputFile + "\"";
    fileargs += "-ab 192 -f mp3";
    fileargs += " \"" + strOutputFile + "\"";
    ffmpegProcess.StartInfo.Arguments = fileargs;
    ffmpegProcess.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
    ffmpegProcess.Start(); 
于 2012-10-10T07:39:38.170 に答える