c++qtqtmultimedia

Qt c++. How to specify the path to save records?


I have a QAudioRecorder object, the audio recording is successful, but the recordings are saved in the default directory, how can I specify my location to store the recordings? Used QAudioRecorder::setOutputLocation() unsuccessfully.


Solution

  • I had the exact same problem, it was only missing file:///

    Modify your path like this and it will work:

    recorder->setOutputLocation(QUrl("file:///C:/mypath/test123.mp3"));