Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Opening QAudioInput very slow, "could not get audio input for record source 1"
Qt 6.11 is out! See what's new in the release blog

Opening QAudioInput very slow, "could not get audio input for record source 1"

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.6k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,

    I open a QAudioInput when starting my Qt Widget application on a Samsung Galaxy S3 Mini with Android 4.1.2 using this procedure:
    @
    m_format.setSampleRate(16000);
    m_format.setChannelCount(1);
    m_format.setSampleSize(16);
    m_format.setCodec("audio/pcm");
    m_format.setByteOrder(QAudioFormat::LittleEndian);
    m_format.setSampleType(QAudioFormat::SignedInt);
    QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
    if (!info.isFormatSupported(m_format)) {
    qWarning() << "Default format not supported, trying to use the nearest.";
    m_format = info.nearestFormat(m_format);
    }

    m_input = new QAudioInput(m_format);
    m_input->setBufferSize(384);
    m_audioData->open(QIODevice::ReadWrite);
    

    @

    It takes very long (approx. 50 secs) for the app to start. Finally it starts and the input is successfully opened. In the console it says:

    @
    E/AudioRecord(27185): Could not get audio input for record source 1
    E/libOpenSLES(27185): android_audioRecorder_realize(0x586115f0) error creating AudioRecord object
    W/libOpenSLES(27185): Leaving Object:
    E/AudioRecord(27185): Could not get audio input for record source 1
    E/libOpenSLES(27185): android_audioRecorder_realize(0x586115f0) error creating AudioRecord object
    W/libOpenSLES(27185): Leaving Object::Realize (SL_RESULT_CONTENT_UNSUPPORTED)
    @
    Is there a mistake in my procedure? I don't know why it takes so long. When i restart the device and start the app it takes the same time.

    Thanks!

    Regards

    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