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. Recovering from underruns in QAudioOutput, using custom QIODevice

Recovering from underruns in QAudioOutput, using custom QIODevice

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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #1

    Hi all,

    If I use a QIODevice provided by QAudioOutput, it automatically recovers from buffer underruns once I write in more data:
    @
    QIODevice *autoDevice = audioOutput->start();

    // ... Underrun occurs

    autoDevice->write(moreData, length);
    // ... QAudioOutput continues playing
    @

    However, if I provide a custom device, it doesn't automatically recover:
    @
    audioOutput->start(myCustomDevice);

    // ... Underrun occurs

    myCustomDevice->write(moreData, length);
    // ... Nothing happens
    @

    I presumed that in the first case, QAudioOutput internally connects the signals to enable auto-recovery when new data arrives. So, I made sure I emitted the readyRead() and bytesWritten() signals from inside MyCustomDevice::writeData(). That didn't work though.

    Am I missing something? Does QAudioOutput connect signals when I call audioOutput->start(myCustomDevice), or do I have to do it manually?

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    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