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. C#
  4. play a wav file

play a wav file

Scheduled Pinned Locked Moved C#
question
6 Posts 4 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.
  • R Offline
    R Offline
    rzvme
    wrote on last edited by
    #1

    How can i play a simple wav file with my application?

    rzvme

    C L A 3 Replies Last reply
    0
    • R rzvme

      How can i play a simple wav file with my application?

      rzvme

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Not sure if there's anything built in ( for C# 2.0, I thought there was ), but the PlaySound API can be interoped for wavs, for mp3, you can use the Windows Media Player control.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      R 1 Reply Last reply
      0
      • C Christian Graus

        Not sure if there's anything built in ( for C# 2.0, I thought there was ), but the PlaySound API can be interoped for wavs, for mp3, you can use the Windows Media Player control.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        R Offline
        R Offline
        rzvme
        wrote on last edited by
        #3

        i know there is a playsound function and i read on msdn that it is on coredll.dll. the only problem is that i don'y have a coredll.dll.

        rzvme

        C 1 Reply Last reply
        0
        • R rzvme

          i know there is a playsound function and i read on msdn that it is on coredll.dll. the only problem is that i don'y have a coredll.dll.

          rzvme

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          http://www.pinvoke.net/search.aspx?search=playsound&namespace=[All][^] says that it's there, and in winmm.dll. I expect it's really in winmm.dll.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          1 Reply Last reply
          0
          • R rzvme

            How can i play a simple wav file with my application?

            rzvme

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            You are looking for one of these functions :) [DllImport("Winmm.dll", CallingConvention=CallingConvention.Cdecl)] static extern int sndPlaySound(IntPtr buffer, int dwFlags); [DllImport("Winmm.dll", CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)] static extern int PlaySound(string filespec, int hModule, int dwFlags);

            Luc Pattyn

            1 Reply Last reply
            0
            • R rzvme

              How can i play a simple wav file with my application?

              rzvme

              A Offline
              A Offline
              Aby Thomas Varghese
              wrote on last edited by
              #6

              Hi rzvme, Check this link (http://www.codeguru.com/csharp/csharp/cs_graphics/sound/article.php/c6143/[^]) out for a bare bones starter version. Hope this points you in the right direction.

              Thanks and Regards, Aby

              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