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. [solved] QAudioInput 4.6.2 - witch chanel will be first?
Forum Updated to NodeBB v4.3 + New Features

[solved] QAudioInput 4.6.2 - witch chanel will be first?

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

    Hi, All!

    I have written a program, it have got bytes from QAudioInput, analyse its and write to file whet it need. But I have a very starnge effect - first sample coming from right or left channel random (I use stereo). Who can help me?
    @bytesPerSecond = settings.channels()*settings.frequency()*settings.sampleSize()/bitsInByte;

    outArray.resize(bytesPerSecond/partOfSecond);
    outArray.fill(0x00);
    
    audioInput = new QAudioInput(settings, reinterpret_cast<QObject*>(this));
    /*    qDebug() << "started with: \n\r Frequency:" <&lt; audioInput-&gt;format().frequency()\
                 << "\n\r N of chanels:" <&lt; audioInput-&gt;format().channels()\
                 << "\n\r SampleSize:" <&lt; audioInput-&gt;format().sampleSize()\
                 << "\n\r SampleType:" <&lt; audioInput-&gt;format().sampleType()\
                 << "\n\r ByteOrder:" <&lt; audioInput-&gt;format().byteOrder();
                 */
    

    // debug info always the same!!!
    audioInput->start( &buffer);
    // audioInput->suspend();
    @

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

      Hi and welcome to devnet,

      What OS are you using ?

      On a side note, you don't need to cast this. In the other cases, you should use qobject_cast when dealing with QObject derived class.

      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
      • H Offline
        H Offline
        Hoksmur
        wrote on last edited by
        #3

        Linux embedded, ARM 9,based on Debian.
        About cast - I will try it without cast. On desktop it builded ok. And I should try to write wav thirdsite program, I think.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hoksmur
          wrote on last edited by
          #4

          All, I localised the problem. I run arecord utilite few times, and - the same effect! It means - reason isn't in Qt . Sorry

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

            No problem :)

            Then, can you update the thread title prepending [solved] ? So other forum users may know an answer has been found :)

            Happy coding !

            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

            • Login

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