Results 1 to 5 of 5

Thread: 'Pop' at start of sound playback using QAudioOutput

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: 'Pop' at start of sound playback using QAudioOutput

    Took some digging but I found it. Hopefully this works for you. The modification was actually within the 'getWaveFormat' function. It basically reads all the necessary format info from the wave file header, and then sets the play start position of the file.
    Basically when you want to play the file, create a new object of SoundPlayer with the filename as an argument. The sound will play automatically, and should emit the signal 'soundDone()' when done.

    ex:
    Qt Code:
    1. SoundPlayer *sPlay = new SoundPlayer(fName, this); //sound will start playing automatically
    2. connect(sPlay, SIGNAL(soundDone()), SLOT(soundDone())); //delete the sPlay object when done
    To copy to clipboard, switch view to plain text mode 

    Probably the SoundPlayer code could be optimized quite a bit. I only focussed on getting it working, then when I did I happened to move on to another project (typical!).

    Cheers,
    James
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2014
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: 'Pop' at start of sound playback using QAudioOutput

    Hello. Can you upload the math.h/.cpp too? Thank you a lot!!

Similar Threads

  1. STB Video Playback
    By akhilesh_s in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 19th July 2011, 11:50
  2. How to playback a IP cam?
    By rayner in forum General Programming
    Replies: 3
    Last Post: 6th December 2010, 21:52
  3. Multiple wav playback
    By cueMan in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2010, 15:51
  4. QAudioOutput help
    By XavierQT in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2010, 10:35
  5. MP3 Sound / OGG Sound Play on GUI
    By patrik08 in forum Newbie
    Replies: 3
    Last Post: 1st September 2006, 19:01

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.