Results 1 to 2 of 2

Thread: QAudioRecorder get stuck in states

  1. #1
    Join Date
    Oct 2011
    Location
    Australia
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default QAudioRecorder get stuck in states

    Hi,

    Using QAudioRecorder (which extends QMediaRecorder), I want to use this flow of events over and over an arbitrary number of times:

    set out file
    record
    stop recording

    QMediaRecorder has a number "statuses" - https://doc.qt.io/qt-5/qmediarecorder.html#status. It also has three "states" but I've found the "states" and not the actual state but what state QMediaRecorder intends to get to. Anyway, the when I try to record then stop a QMediaRecorder it tends to get stuck in certain statuses and I can't make it get out of the status (expect by killing the process). It seems to get stuck in FinalizingStatus and StartingStatus.

    Any ideas of how I can fix this??

    Thanks,

    33333

  2. #2
    Join Date
    Oct 2011
    Location
    Australia
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QAudioRecorder get stuck in states

    After messing around a bit I found a solution that works: Use heap allocated QAudioRecorder, delete and start a new one with each new recording. Don't try to stop the QAudioRecorder before deleting it either - I found that can hang indefinitely on occasion for reasons I have not definitively determined.

    Not sure why this works, must be something in the destructor? I also found that things would freeze up using the default device "default:". Instead I'm using the full name of the ALSA device "alsa:hw:CARD=PCH,DEV=0". I thought the default device was a pseudonym for this but obviously not - weird confusing ALSA crap...
    Last edited by 33333; 7th January 2017 at 00:55.

Similar Threads

  1. QAudioRecorder example produces only a buzzing sound
    By TheIndependentAquarius in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2016, 10:54
  2. Replies: 0
    Last Post: 19th March 2016, 21:27
  3. GroupItems in two states
    By Andre008 in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2016, 11:40
  4. QAudioRecorder and QProgress bar
    By roger78 in forum Qt Programming
    Replies: 2
    Last Post: 29th August 2015, 19:50
  5. Save QAudioRecorder to QByteArray
    By vanillac in forum Qt Programming
    Replies: 5
    Last Post: 28th March 2015, 08:59

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.