Results 1 to 4 of 4

Thread: QSound::isFinished() not working

  1. #1
    Join Date
    Nov 2012
    Posts
    20
    Thanked 1 Time in 1 Post

    Default QSound::isFinished() not working

    I'm using Windows to play a sound using QSound. It plays fine but I need some method for the program to halt until the sound stops.

    Naturally I tried using the isfinished function but it always returns true:

    Qt Code:
    1. QSound aa ("dash300ms1.wav");
    2.  
    3. aa.play();
    4. qDebug()<< aa.isFinished();
    To copy to clipboard, switch view to plain text mode 

    The sound lasts 10 seconds but the finished call returns true instantly. What is happening here?

    Is there another way of doing what I want to achieve?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSound::isFinished() not working

    Read the docs Luke, read the docs...
    Quote Originally Posted by QSound::isFinished() docs
    Warning: On Windows this function always returns true for unlooped sounds.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2012
    Posts
    20
    Thanked 1 Time in 1 Post

    Default Re: QSound::isFinished() not working

    Well, forgive me my impetuosity, but shouldn't it be fixed?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSound::isFinished() not working

    Quote Originally Posted by tom989 View Post
    Well, forgive me my impetuosity, but shouldn't it be fixed?
    Be my guest, fix it
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QSound question
    By franco.amato in forum Newbie
    Replies: 2
    Last Post: 13th June 2012, 23:55
  2. Using QSound::play("...") not working
    By Charvi in forum Qt Programming
    Replies: 18
    Last Post: 3rd April 2012, 11:51
  3. QSound on Mac
    By loveablepocky in forum Newbie
    Replies: 0
    Last Post: 16th February 2011, 01:29
  4. QSound.
    By csvivek in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2008, 22:02
  5. Is QSound all there is?
    By ad5xj in forum Newbie
    Replies: 4
    Last Post: 1st September 2007, 01:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.