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. How to record software generated audio ??
Qt 6.11 is out! See what's new in the release blog

How to record software generated audio ??

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.7k 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.
  • GianlucaG Offline
    GianlucaG Offline
    Gianluca
    wrote on last edited by
    #1

    Dear all,
    I'm trying to encode and to save as AAC audio file a stream generated via software by my app.
    My first idea was to use the QMediaRecorder for that, but I cannot find a way to use it setting as audio input my generated stream. It seems that supports only hardware input devices :-S
    So, there is no way to use Qt Multimedia module to create apps for generating musics ??

    Thanks,
    Gianluca.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      take a look at QAudioInput and QAudioOutput classes

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • GianlucaG Offline
        GianlucaG Offline
        Gianluca
        wrote on last edited by
        #3

        I did !
        But they are not useful for what I need to do.
        They are low-level access to the audio streams... but again, they allow to attach an hardware device to a software buffer... and they do not encode nothing.

        What I need is to encode an audio stream generated from me and not from an hardware device.

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          sure you can write a stream to a file using these classes. See "this example":http://qt-project.org/doc/qt-5/qaudioinput.html#details in the docs. You just have to worry about the supported codecs.

          Alternatively "this":https://github.com/visore/QAudioCoder might also be interesting for you.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • GianlucaG Offline
            GianlucaG Offline
            Gianluca
            wrote on last edited by
            #5

            I'll take a look to the github project.

            And for what concern the example you posted... in the example the audio stream comes from the hardware device and it's not what I need.

            I'll try to explain in more details what I need:

            • there is a C++ method that generate an audio stream of data (RAW audio, suppose PCM 16bit unsigned)
            • I want to connect this stream of data to one of the multimedia classes for encode it into AAC and saving on the disk in MP4 format.

            From what I saw in the multimedia classes, the audio stream was always coming from an hardware device and not from a buffer or a QIODevice.
            So, I'm wondering what I miss.

            Another scenario similar to what I need:
            suppose you need to convert a file from AAC/MP4 to Vorbis/Ogg
            So, digging into the multimedia documentation there is the QAudioDecoder that allow you to load and decode the AAC/MP4 file ... but then ?!?!
            What multimedia class allow you to write the decoded audio into Vorbis/Ogg ?!?! QMediaRecorder ?!?! but how to connect to QAudioDecoder ?!?!

            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