Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Sound

Sound

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Polymorpher
    wrote on last edited by
    #1

    Does anyone know how to play ascyncronus sound in VB.Net? Im still getting used to the framework. I was going to thread my class, but im sure there is a better way. Any help would be aprciated. Pablo

    B 1 Reply Last reply
    0
    • P Polymorpher

      Does anyone know how to play ascyncronus sound in VB.Net? Im still getting used to the framework. I was going to thread my class, but im sure there is a better way. Any help would be aprciated. Pablo

      B Offline
      B Offline
      Briga
      wrote on last edited by
      #2

      Your question is rather vague: which framework version? What type of sound? If you're using VB2005 and have a wav file then the easiest way is using the my.computer.audio.play reference. The official documentation explain it well (and it's really plain vanilla).

      ' Usage
      My.Computer.Audio.Play(location)
      My.Computer.Audio.Play(location ,playMode)
      My.Computer.Audio.Play(data ,playMode)
      My.Computer.Audio.Play(stream ,playMode)
      ' Declaration
      Public Sub Play( _
      ByVal location As String _
      )
      ' -or-
      Public Sub Play( _
      ByVal location As String, _
      ByVal playMode As AudioPlayMode _
      )
      ' -or-
      Public Sub Play( _
      ByVal data As Byte(), _
      ByVal playMode As AudioPlayMode _
      )
      ' -or-
      Public Sub Play( _
      ByVal stream As System.IO.Stream, _
      ByVal playMode As AudioPlayMode _
      )

      P 1 Reply Last reply
      0
      • B Briga

        Your question is rather vague: which framework version? What type of sound? If you're using VB2005 and have a wav file then the easiest way is using the my.computer.audio.play reference. The official documentation explain it well (and it's really plain vanilla).

        ' Usage
        My.Computer.Audio.Play(location)
        My.Computer.Audio.Play(location ,playMode)
        My.Computer.Audio.Play(data ,playMode)
        My.Computer.Audio.Play(stream ,playMode)
        ' Declaration
        Public Sub Play( _
        ByVal location As String _
        )
        ' -or-
        Public Sub Play( _
        ByVal location As String, _
        ByVal playMode As AudioPlayMode _
        )
        ' -or-
        Public Sub Play( _
        ByVal data As Byte(), _
        ByVal playMode As AudioPlayMode _
        )
        ' -or-
        Public Sub Play( _
        ByVal stream As System.IO.Stream, _
        ByVal playMode As AudioPlayMode _
        )

        P Offline
        P Offline
        Polymorpher
        wrote on last edited by
        #3

        Thanks for the response. I figured it out. I had to import a dll that i wasnt importing. I'm using VB.Net 2003 For playing .wav files for now and latter i will be adding suport for other formats. Im going to write the sound manager in C# now though and just make a DLL from it. Thanks agaian Pablo

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups