Results 1 to 2 of 2

Thread: Help with sound in vb//why wont it work?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2008
    Posts
    21

    Help with sound in vb//why wont it work?

    Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    If e.KeyCode = Keys.A Then
    My.Computer.Audio.Play(My.Resources.Matrix_Revolutions_Soundtrack___Tetsujin, AudioPlayMode.Background)
    End If
    End Sub

    Its wierd because the form loads but when i press the a key nothing happens

    please help me!!

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Help with sound in vb//why wont it work?

    Hi,

    This should normaly work only for wave files:

    vb Code:
    1. My.Computer.Audio.Play("Path to wav file", AudioPlayMode.BackgroundLoop)

    What you can do is rename your wave file in the resources folder and try it again.

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width