Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Pass QAudioDeviceInfo as parameter in Qml
Forum Updated to NodeBB v4.3 + New Features

Pass QAudioDeviceInfo as parameter in Qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 906 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.
  • S Offline
    S Offline
    saeidparand
    wrote on last edited by
    #1

    Dear Friend :
    how can I pass QAudioDeviceInfo as a parameter in slot in qml?
    In fact I want using microphone of my device for taking or recording any voice.
    I read QT QAudioinput sample and I want use this code in QML.

    this is my code in C++ :
    void AudioInput::testslot(const QAudioDeviceInfo &deviceInfo){//do something}

    this is QML :
    import audioqml 1.0 //module c++ written by myselft
    AudioInput{
    id:tst

    }
    
    
    
    Button{
        id:btn
        text:"click me audio start"
        onClicked: tst.testslot()
    }
    

    how can I handle this challenge?

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

      Hi,

      What information do you need from QAudioDeviceInfo ?

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

      S 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        What information do you need from QAudioDeviceInfo ?

        S Offline
        S Offline
        saeidparand
        wrote on last edited by
        #3

        @SGaist : I just want take any voice in microphone , I want take any voice from microphone

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

          So you just want your application user to be able to select the correct audio input ?

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

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            So you just want your application user to be able to select the correct audio input ?

            S Offline
            S Offline
            saeidparand
            wrote on last edited by
            #5

            @SGaist : Yes , I want detect any voice or audio input in my application

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

              Then create a small class that will provide the list of available audio input names to your QML code and base your selection on that. That will be way simpler than trying to path QAudioDeviceInfo.

              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
              1

              • Login

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