Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Synchronous sound
 

 

Description

This example plays a wav file synchronously , Put the wav file in the same location as the source code .

Code

#include <windows.h>
#include <stdio.h>

int main()
{

printf("Playing synchronous sound...\n");
PlaySound("The Microsoft Sound.wav", NULL, SND_FILENAME | SND_SYNC);
return 0;
}

Information

tested using Visual C++ 6

You have to add a library to the project or you will get errors . To do this do the following .

1/ Go to the Project menu and click on settings or press Alt F7
2/ Click on the Link tab
3/ Where it says Object/library modules type in winmm.lib. I usually go right to the end and do this .
4/ Now click on OK .

 

 
 

 

Download

syncsound.txt
The Microsoft Sound.wav


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
read the contents of an ini file(php)
shutdown or restart(VB)
get windows system directory(VB)
hexadecimal to decimal conversion(PHP)
Rainbow text(Javascript)
echo keyboard input to screen(Darkbasic)
Get the windows directory(VB)
get the date(Javascript)

    




Copyright © 2003 by programmershelp.co.uk