Audio Play button from string

Hello over there..

Newb over here..

I'm trying to get a push button to do a 'play' function using the source audio location as a String from a Textbox..

Everything looking good but I can't get the play button to accept the passdown of the String sound location. All help/critique is good. Many thanks.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles P1.Click

Dim TempMedia As New System.Media.SoundPlayer( New stream(TextBox1 As String) TempMedia.Play())

End Sub

**Expected Comma, ')' or a valid expression.



Answer this question

Audio Play button from string

  • Eric Wellnitz

    Hmm. There might be some info in my online book about calling subs and all. Take a look here -> www.wickedorange.com/vb2005intro



  • scribework

    Nevermind.. Solved!

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles P1.Click

    Dim TempMedia As New System.Media.SoundPlayer(TextBox1.Text)

    TempMedia.Play()

    End Sub


  • Audio Play button from string