Beep command help

This is a discussion on Beep command help within the C++ Programming forums, part of the General Programming Boards category; Yes, that's a Win32 API function. It should be in your compiler's documentation, or there's always MSDN . I don't ...

  1. #16
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Yes, that's a Win32 API function. It should be in your compiler's documentation, or there's always MSDN.

    I don't know the exact syntax, and the machine I'm on right now doesn't have a compiler, so I can't try it out. PlaySound("TADA.WAV") might work, but you might have to include the full path name or copy TADA.WAV from your media folder to your current directory.

    I think the other two paramaters are optional, but you may need something like this: PlaySound("C:TADA.WAV", NULL, SND_FILENAME), or maybe PlaySound("C:\\WINNT\\MEDIA\\TADA.WAV", NULL, SND_FILENAME | SND_ASYNCH).

    Note that PlaySound() only works for short sounds that fit into the RAM buffer. (I don't know the real limits, but you can't play a full song ripped from a CD with it.) And, it only works for WAV files. If you want to play an MP3, you have to decode it first.

    Another way to make sounds is with MIDI. It can get complicated, but I was able to write a short program (less than 20 lines of "real code") to play a few notes or chords from what I learned on this site.
    Last edited by DougDbug; 09-06-2006 at 08:08 PM.

  2. #17
    Or working on it anyways mramazing's Avatar
    Join Date
    Dec 2005
    Location
    Lehi, UT
    Posts
    121
    thank you very much !
    -- Will you show me how to c++?

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linux beep function
    By Calef13 in forum C++ Programming
    Replies: 7
    Last Post: 07-14-2007, 01:39 AM
  2. I need to play a pre recorded vox file using C
    By m.sudhakar in forum C Programming
    Replies: 4
    Last Post: 11-17-2006, 05:59 PM
  3. alert beep sound
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 02-14-2006, 01:24 PM
  4. Beep();
    By SirCrono6 in forum C++ Programming
    Replies: 7
    Last Post: 02-22-2004, 03:47 PM
  5. Something Like beep()
    By Trauts in forum C++ Programming
    Replies: 3
    Last Post: 02-02-2003, 01:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21