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. Audio Input Example
Forum Updated to NodeBB v4.3 + New Features

Audio Input Example

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 931 Views 2 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.
  • B Offline
    B Offline
    Bjorn R.
    wrote on last edited by
    #1

    Hi! I'm trying to run the Audio Input Example - running it in debug mode is all fine and dandy, but running it in release mode yields no data from the mic (the amplitude bar is not displaying anything), with an accompanying message:

    • QIODevice::write (AudioInfo): device not open

    Trying to debug if the QIODevice is open or not, returns "open".

    Snippet from example, toggling between push and pull modes:

        // Change bewteen pull and push modes
        if (m_pullMode) {
            m_modeButton->setText(tr("Enable push mode"));
            m_audioInput->start(m_audioInfo.data());
            qDebug() << "Is device open?: " << m_audioInfo.data()->isOpen();
        } else {
            m_modeButton->setText(tr("Enable pull mode"));
            auto io = m_audioInput->start();
            qDebug() << "Is device open?: " << io->isOpen();
    

    Any ideas?

    Qt Creator 4.8.0
    Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)
    Mac OS Mojave 10.14.2

    Br,
    Bjørn Rudi

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Just a wild guess, but since Mojave, you may have to give permission to access the microphone to your application in release mode.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bjorn R.
        wrote on last edited by
        #3

        Thanks SGaist!

        I'm able to make it work by navigating to the build folder and running the .app from there, with appropriate permissions - but still not working by running it from Qt creator.

        Enabling "Run in terminal" enables the audio when running it from Qt Creator though..

        /Bjorn

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          There might be something you can add to the plist file of the application but I currently don't know the exact key.

          This article might also provide a solution in the mean time.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bjorn R.
            wrote on last edited by Bjorn R.
            #5

            So tested the key:
            NSMicrophoneUsageDescription

            as described in:
            https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos

            in a custom Info.plist (copy-pasted the default .plist and added the new key), defined in the .pro file with:
            QMAKE_INFO_PLIST = Info.plist

            but still no audio.

            Resetting the microphone permissions (via tccutil) requires me to accept microphone usage when running the .app from e.g. finder, but will still not prompt me for mic .usage when running the application from Qt Creator in Release mode.

            /Bjorn

            1 Reply Last reply
            0
            • B Offline
              B Offline
              Bjorn R.
              wrote on last edited by
              #6

              Just found this thread:
              https://forum.qt.io/topic/97570/macos-mojave-privacy-prompt-not-appearing-when-debugging-audio-app-in-qt-creator/6

              that deals with the same issue regarding microphone audio issues in Mojave. The solution does not seem to work for me. Interestingly, I get:

              "Unable to load Info.plist exceptions (eGPUOverrides)"

              when running the application in debug mode.

              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