Important: Please read the Qt Code of Conduct -

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

  • 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;

    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();

  • Lifetime Qt Champion

    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.

  • 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.

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

  • Lifetime Qt Champion

    No problem :)

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

    Happy coding !

Log in to reply