Skip to content
  • 0 Votes
    4 Posts
    739 Views
    Christian EhrlicherC

    And the setBuffer() function you use has exact the same problem.

  • Need help with QAudioInput

    Solved General and Desktop
    2
    0 Votes
    2 Posts
    232 Views
    SGaistS

    Hi,

    You can start from the sample in the class documentation and change the sample size to 16.

  • 0 Votes
    6 Posts
    784 Views
    RobotechnicR

    I fixed my problem:

    with a qDebug of lenght I have:

    data.length() lenght 136 2730 740 1364 1326 1366 414 1364 208 1366 458 1364

    As you can see they are not the same so, with this code, my problem is fixed:

    void Window::processAudioFrame(QByteArray data){ const short* result = (short *)data.constData(); for (int i=0; i < data.length()/2; i ++ ){ ui->soundView->pushSoundLevel(result[i]); } }
  • 1 Votes
    2 Posts
    891 Views
    P

    @RedMarsBlueMoon How do you iterate through the available devices? Could you give a code snippet? We use QtQuick and use the Audio component to play audio. So nowhere in the code do we get a list of audio devices or iterate through them.

  • 0 Votes
    3 Posts
    2k Views
    J

    It worked! I had done it before but it was adding to the errors, and when I solved those I forgot to re add that. Thanks!

  • 0 Votes
    2 Posts
    1k Views
    JakeJ

    This appears to be a QT Android deployment issue.
    It also looks like some sample apps are hard coded to particular Qt release?

    The following is what I did to fix sound for the Maroon sample app (a QtQuick/QML app) on Qt 5.6 for Android x86.

    The fix for: "Maroon In Trouble".
    Modified the resource: SoundEffect.qml:
    Added (missing!?):
    import QtMultimedia 5.6

    Modified the following line, changing the library from 5.0 to 5.6:
    property QtObject effect: Qt.createQmlObject("import QtMultimedia 5.6; SoundEffect{ source: '" + container.source + "'; muted: !Qt.application.active }", container);

    Applying the above changes added one additional library to the Android plugin/lib directory
    ...android-build\libs\x86\*.so -> libqml_QtMultimedia_libdeclarative_multimedia.so

    Note: libplugins_audio_libqtaudio_opensles.so was present in: ...android-build\libs\x86\ before I added the import statement, but this library may not have been actually deployed? (hence the log message "QtMultimedia" is not installed)

    Note: It appears that 5 additional dependencies from Qt are reported to be added to the package.

    It appears that it is not enough to have an entry in the *.pro for qtHaveModule(multimedia): QT += multimedia as the Qt sound libraries are not deployed? I think adding the import statement probably changed what was actually deployed, but someone better informed about apk's & how deployment works can probably explain this better.

    Now I need to understand how to do the equivalent deployment fix for my C++ app. Does anyone know the equivalent to the above "import" statement?, to ensure that ALL the multimedia files libraries/plugins are deployed? As I think I am running into the very same issue. Where does one put the import statement in a C++ app?

    Thanks in advance!
    Jake

  • 0 Votes
    9 Posts
    4k Views
    M4RZB4NiM

    @yuvaram
    thanks a lot :)

  • 0 Votes
    2 Posts
    1k Views
    X

    this works. if you use jactivity.callObjectMethod instead of jactivity.callMethod it just crashes.

    QAndroidJniObject jactivity=QtAndroid::androidActivity();
    if(jactivity.isValid())
    jactivity.callMethod<void>("setVolumeControlStream","(I)V",3);