首页 > 解决方案 > 在 .NET 上使用 ffplay / ffmpeg 播放 ogg 文件

问题描述

我正在尝试使用 VB.NET 播放 Ogg 文件,ffplay.exe但我不知道具体如何。这是我的代码:

Private Sub ButtonIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonIR.Click
    If IsNotNothing(TextBoxSource.text) Then
        TextBoxDETALLES.Clear()
        Try
            Dim CONVERSOR As New Process

            CONVERSOR.StartInfo.FileName = "C:\ffplay.exe"
            CONVERSOR.StartInfo.Arguments = TextBoxSource.Text 
            CONVERSOR.StartInfo.UseShellExecute = False 
            CONVERSOR.StartInfo.RedirectStandardOutput = True 
            CONVERSOR.StartInfo.RedirectStandardError = True 
            CONVERSOR.StartInfo.CreateNoWindow = True 

            CONVERSOR.Start() 

            While Not CONVERSOR.StandardError.EndOfStream
                TextBoxDETALLES.AppendText(CONVERSOR.StandardError.ReadLine & vbCrLf) 

                Application.DoEvents()
            End While

            MsgBox("HECHO") 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    Else
        MsgBox("Error")
    End If
End Sub

我不是在尝试转换它,而是在尝试播放它。

标签: vb.netaudioffmpegx86ogg

解决方案


推荐阅读