Results 1 to 6 of 6

Thread: 'QSound': No such file or directory

  1. #1
    Join Date
    Mar 2013
    Posts
    45
    Thanks
    23
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default 'QSound': No such file or directory

    hi

    when i use :

    Qt Code:
    1. #include <QSound>
    To copy to clipboard, switch view to plain text mode 

    i get this error message :

    'QSound': No such file or directory
    i added this text to my.pro :


    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets multimedia

  2. #2
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: 'QSound': No such file or directory

    After adding multimedia, did your run qmake again & rebuild ?

  3. #3
    Join Date
    Mar 2013
    Posts
    45
    Thanks
    23
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: 'QSound': No such file or directory

    solved : I cleaned "build-Desktop_Qt_5_0_0_MSVC2010_32bit_SDK-Debug" and rebuilding my project .

    But I hear no sound

    Qt Code:
    1. void MainWindow::on_pushButton_clicked()
    2. {
    3. QSound sound(":/Music/exelent.wav");
    4. sound.setLoops(1);
    5. sound.play();
    6. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Apr 2015
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: 'QSound': No such file or directory

    I got my program (Qt 5.1 based) to compile with this trick.
    However during runtime I got; QSoundEffect(qaudio): Error decoding source (audio file is played ok in windows player)

  5. #5
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: 'QSound': No such file or directory

    Your code destroys the QSound instance immediately after scheduling the sound for playing. You should either extend the scope of the QSound or use the static QSound:lay() method.

  6. #6
    Join Date
    Apr 2015
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: 'QSound': No such file or directory

    Quote Originally Posted by mnokka View Post
    I got my program (Qt 5.1 based) to compile with this trick.
    However during runtime I got; QSoundEffect(qaudio): Error decoding source (audio file is played ok in windows player)

    Found solution for the runtime issue; By using QMediaPlayer (Qt5.1 , WIN7 x64) I was able to play .wma and .mp3 files ok

Similar Threads

  1. QSound and the resource file
    By dhice in forum Qt Programming
    Replies: 7
    Last Post: 19th May 2017, 17:42
  2. not able to use QSound to play wave file
    By Ratheendrans in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2012, 15:14
  3. Replies: 0
    Last Post: 2nd March 2011, 08:36
  4. Replies: 4
    Last Post: 9th May 2010, 16:18
  5. playing mp3 file with QSound
    By highlightsong in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2008, 09:24

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.