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. Sounds and Music

Sounds and Music

Scheduled Pinned Locked Moved Visual Basic
learningcsharptutorialquestion
3 Posts 3 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.
  • T Offline
    T Offline
    TGWDNGHN
    wrote on last edited by
    #1

    Hi! I'm totally new in VB.net... I bought The VB.net Deluxe Learning Edition 2003 kit... I may not be done with it (almost though) but as I skimmed through the book I noticed that it does NOT show you how to play sounds and music... (I'm not usre if it even teaches you Avis!) I was just wondering what object do i need to use to open and play sonds and music... Or if there is no object... HOW DO YOU DO IT?! BTW: I looked aeverywhere for the answer already... Thnx :confused:

    J 1 Reply Last reply
    0
    • T TGWDNGHN

      Hi! I'm totally new in VB.net... I bought The VB.net Deluxe Learning Edition 2003 kit... I may not be done with it (almost though) but as I skimmed through the book I noticed that it does NOT show you how to play sounds and music... (I'm not usre if it even teaches you Avis!) I was just wondering what object do i need to use to open and play sonds and music... Or if there is no object... HOW DO YOU DO IT?! BTW: I looked aeverywhere for the answer already... Thnx :confused:

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      For sound, use the sndPlaySound() API. For video, use the Windows Media Player control or something similar.

      "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
      "You must be the change you wish to see in the world." - Mahatma Gandhi

      D 1 Reply Last reply
      0
      • J J Dunlap

        For sound, use the sndPlaySound() API. For video, use the Windows Media Player control or something similar.

        "Blessed are the peacemakers, for they shall be called sons of God." - Jesus
        "You must be the change you wish to see in the world." - Mahatma Gandhi

        D Offline
        D Offline
        dynamic
        wrote on last edited by
        #3

        an old example in .net i did for someone a few months ago , might give you a helping hand with the sound

        Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
        (ByVal lpszSoundName As String, ByVal uFlags As Integer) As Long
        Const SND_SYNC As Integer = &H0
        Const SND_ASYNC As Integer = &H1
        Const SND_NODEFAULT As Integer = &H2
        Const SND_LOOP As Integer = &H8
        Const SND_NOSTOP As Integer = &H10
        Dim SoundName As String, wFlags As Integer, x As String

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SoundName = "C:\Documents and Settings\Den\My Documents\Visual Studio Projects\WindowsApplication1\beav_rap.wav"
        wFlags = SND_ASYNC Or SND_NODEFAULT
        x = sndPlaySound(SoundName, wFlags)

        End Sub
        

        Private void ExpectingTwins(string twins)
        {
        switch(twins)
        {
        Case ("twins on the way"):
        MessageBox.Show("for mr and mrs dynamic","twins on the way");
        break;
        }
        }


        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