Thread: What is wrong with my Playsound(); program?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    106

    What is wrong with my Playsound(); program?

    #include <iostream>
    #include <string>
    #include <windows.h>
    #include <mmsystem.h>

    int main()
    {
    bool bStillplaying=true;
    string quit="";

    while(bStillplaying) {
    PlaySound("Beethoven.mid", NULL, SND_FILENAME | SND_ASYNC);
    for (int i=0;i<=7;i++) {
    cout << ".";
    Sleep(200); }

    cout << "currently playing a song.\n";
    Sleep(500);

    for (int i=0;i<=7;i++) {
    cout << ".";
    Sleep(200); }

    cout << "press q to quit" << endl;
    cin >> quit;

    if (quit=='q' || quit=='Q') {
    Sleep(500);
    bStillplaying=false;
    return 0; }
    }
    Sleep(500);
    return 0;
    }
    Last edited by Ruflano; 03-29-2002 at 08:11 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 01-13-2007, 02:14 AM
  2. What is wrong with my code? My first program......
    By coreyt1111 in forum C++ Programming
    Replies: 11
    Last Post: 11-14-2006, 02:03 PM
  3. Whats wrong with this program - Output of a series
    By duffmckagan in forum C Programming
    Replies: 2
    Last Post: 07-26-2006, 09:57 AM
  4. Whats wrong with my program?
    By Ruflano in forum C++ Programming
    Replies: 5
    Last Post: 02-21-2002, 05:09 PM
  5. what's wrong with my newbie program??
    By insoolated in forum C++ Programming
    Replies: 1
    Last Post: 09-14-2001, 08:49 PM