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. Generating a sound
Forum Updated to NodeBB v4.3 + New Features

Generating a sound

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 7.5k 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.
  • N Offline
    N Offline
    noobiept
    wrote on last edited by
    #1

    Hey, is there a tone generator in qt, where you could generate a sound? (the beep kind of sound.. - single frequency tone)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      For generating arbitrary tones? No. There is a "beep":http://doc.qt.nokia.com/4.7/qapplication.html#beep function in QApplication that will play your system beep. But not a tone generator in the "play simple tunes" sense.

      There are various multimedia APIs in Qt, but primarily are concerned with playback of media files and that sort of thing.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        noobiept
        wrote on last edited by
        #3

        ok, thanks anyway.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jupiter
          wrote on last edited by
          #4

          if you have a sound file you can play it with QSound::play

          1 Reply Last reply
          0
          • N Offline
            N Offline
            noobiept
            wrote on last edited by
            #5

            No, haven't got any file.

            I've found this "tutorial":http://doc.qt.nokia.com/4.7-snapshot/multimedia-audiooutput.html , it seems to be generating a sound, I'll try to understand the code.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              smileeFace
              wrote on last edited by
              #6

              Hello,

              I know this post was from a few years ago. Is there still no way to generate a tone if I were to pass volume and frequency?

              Edit: Found that I could just use Windows.h's Beep(..). All I needed was a basic tone of which I could set the frequency. How pretty it sounded didn't matter. Planning on making an abstraction layer so that when I change to another platform, I would only have to change this system specific file.

              1 Reply Last reply
              0

              • Login

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