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

  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.

  2. #2
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    *Don't re-define i
    *You have to use the standard namespace (using namespace std
    *For "string" types, you can't compare them as char. Use " instead of '
    *And there's something else... but I don't know enough about playing sounds or the <mmsystem.h> header

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    ok, why'd you block me on AIM? Do I bother you too much?

  4. #4
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    I blocked you?

    I'm not even on right now lol... I'll get on

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    30
    Whats ur aim? i wanna talk to someone that might be able to help me
    HOw are ya?

  6. #6
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    My AIM is jpa9804421

    a bit long, heh.

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    my AIM is Gbonny2753

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