Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Beep function is blocking the QT application.

Beep function is blocking the QT application.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 667 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ayush Gupta
    wrote on last edited by
    #1

    Currently I am using Beep function to generate the sound with required frequency and duration.

    WINBASEAPI WINBOOL WINAPI Beep (DWORD dwFreq, DWORD dwDuration);

    But it is blocking the QT application and my application do not send messages when this function is executed.

    Is it any other way I can play sound with required frequency and duration ? May be some way using QMediaPlayer ?

    JKSHJ JonBJ 2 Replies Last reply
    0
    • A Ayush Gupta

      Currently I am using Beep function to generate the sound with required frequency and duration.

      WINBASEAPI WINBOOL WINAPI Beep (DWORD dwFreq, DWORD dwDuration);

      But it is blocking the QT application and my application do not send messages when this function is executed.

      Is it any other way I can play sound with required frequency and duration ? May be some way using QMediaPlayer ?

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Ayush-Gupta said in Beep function is blocking the QT application.:

      Is it any other way I can play sound with required frequency and duration ? May be some way using QMediaPlayer ?

      QSound is more lightweight than QMediaPlayer. You'll need to supply your own beeping .wav file.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2
      • A Ayush Gupta

        Currently I am using Beep function to generate the sound with required frequency and duration.

        WINBASEAPI WINBOOL WINAPI Beep (DWORD dwFreq, DWORD dwDuration);

        But it is blocking the QT application and my application do not send messages when this function is executed.

        Is it any other way I can play sound with required frequency and duration ? May be some way using QMediaPlayer ?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Ayush-Gupta
        If you can/are prepared to use a Qt call like @JKSH's QSound I would favor that way.

        But if for some reason it's not suitable and you want to stick with WINAPI Beep(), and you say it blocks while sounding, you may be able to call just this from a thread so your Qt app remains responsive. You would have to test this out to see if it works OK, I don't know.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved