wma 스트림을 mp3 스트림으로 실시간 변환 할 수 있습니까?wma 스트림을 C# 및 ffmpeg로 mp3 스트림으로 변환
나는이 같은 일을하고 있지만 행운을 가지고 있지 시도 : 내가 뭘하려고 오전 (MP3의 바이트 블록에 WMA의 바이트 블록 변환)도 가능하면
WebRequest request = WebRequest.Create(wmaUrl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
int block = 32768;
byte[] buffer = new byte[block];
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.ErrorDialog = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.FileName = "c:\\ffmpeg.exe";
p.StartInfo.Arguments = "-i - -y -vn -acodec libspeex -ac 1 -ar 16000 -f mp3 ";
StringBuilder output = new StringBuilder();
p.OutputDataReceived += (sender, e) =>
{
if (e.Data != null)
{
output.AppendLine(e.Data);
//eventually replace this with response.write code for a web request
}
};
p.Start();
StreamWriter ffmpegInput = p.StandardInput;
p.BeginOutputReadLine();
using (Stream dataStream = response.GetResponseStream())
{
int read = dataStream.Read(buffer, 0, block);
while (read > 0)
{
ffmpegInput.Write(buffer);
ffmpegInput.Flush();
read = dataStream.Read(buffer, 0, block);
}
}
ffmpegInput.Close();
var getErrors = p.StandardError.ReadToEnd();
그냥 궁금. 다른 가능한 C# 솔루션이있는 경우 열 수 있습니다.
감사
당신이 입력으로 WMA 파일을 출력으로 MP3 파일을 생성 할 것 같습니다