Results 1 to 2 of 2

Thread: QAudioOutput buffer underrun

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QAudioOutput buffer underrun

    Hi, I was planning to write a small VOIP program using QUdpSockets, but this always ended in buffer underrun problems. I looked with Wireshark whether the receiving end was getting packets and it was.
    To better understand the problem, I made the following ridiculous code that gets data from the QAudioInput component via the QIODevice "device" and gives this device to QAudioOutput that I expected to play the audio from the microphone. But it doesn't, the QAudioOutput still gives "buffer underrun" messages.

    Anyone has an idea what i'm doing wrong?

    Qt Code:
    1. AudioController::AudioController()
    2. {
    3. // Set up the format, eg.
    4. format.setFrequency(10100);
    5. format.setChannels(1);
    6. format.setSampleSize(8);
    7. format.setCodec("audio/pcm");
    8. format.setByteOrder(QAudioFormat::LittleEndian);
    9. format.setSampleType(QAudioFormat::UnSignedInt);
    10.  
    11. QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
    12. if (!info.isFormatSupported(format)) {
    13. qDebug("raw audio format not supported by backend, cannot play audio.");
    14. return;
    15. }
    16.  
    17. input = new QAudioInput(format, this);
    18. output = new QAudioOutput(format, this);
    19.  
    20. connect(input,SIGNAL(stateChanged(QAudio::State)),SLOT(inputPlaying(QAudio::State)));
    21. device = input->start();
    22.  
    23. connect(output,SIGNAL(stateChanged(QAudio::State)),SLOT(outputPlaying(QAudio::State)));
    24. output->start(device);
    25.  
    26. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QAudioOutput buffer underrun

    I still haven't figured out what to do to solve this buffer underrun problem. Is there nobody who has experience in this field?
    Thx

Similar Threads

  1. Replies: 1
    Last Post: 29th July 2010, 13:35
  2. QAudioOutput help
    By XavierQT in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2010, 10:35
  3. QImage buffer
    By rafaelsegundo in forum Qt Programming
    Replies: 3
    Last Post: 24th June 2008, 06:48
  4. Double Buffer
    By ^NyAw^ in forum Qt Programming
    Replies: 23
    Last Post: 29th January 2008, 18:35
  5. Buffer
    By AnithaRagupathy in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2007, 06:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.