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. How to play a sound from my program.

How to play a sound from my program.

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelptutorial
2 Posts 2 Posters 1 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.
  • C Offline
    C Offline
    CodeItWell
    wrote on last edited by
    #1

    How to play a sound from my program. I have Visual Studio 2003. Net 1.0.] Help.

    Vasildb

    M 1 Reply Last reply
    0
    • C CodeItWell

      How to play a sound from my program. I have Visual Studio 2003. Net 1.0.] Help.

      Vasildb

      M Offline
      M Offline
      Merlin Tintin
      wrote on last edited by
      #2

      using System.Runtime.InteropServices; [System.Runtime.InteropServices.DllImport("kernel32")] private static extern int Beep(int dqFreq, int dqDuration); Beep (3000,25); => It will play a nice beep like in '80 years ;P If you are not happy with that you can also use the MCI functionalities provoded by the API (need import also) or ... simply play wave with: [System.Runtime.InteropServices.DllImport("Winmm.dll")] private static extern bool PlaySound(byte[] data, IntPtr hMod, UInt32 dwFlags);

      La Richesse & la Gloire ne griseront jamais que les temples

      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