Qt Audio Recorder: How to fix a path to save recorded audio files

  • I'm new to Qt and I'm using the example provided by Qt to develop an audio recorder.

    The requirements given is to make 6 radio channels, only 1 channel can be selected at the moment of recording. I'm wondering how I can fix a path for each of the channels to save the audio files recorded, and how to make the name of each file fixed (e.g message1.wav). Each time when there's a new recording in a particular channel, the old .wav file is to be replaced by the new one.

    Lastly, user has to be able to play the recordings on the panel instead of opening the path and run the .wav file.

    Once again I'm very new to all of this and I hope my description is understandable. As I said I'm using the Audio Recorder Example in Qt creator as a footstone, so you can guide me on which part of the code I have to change or add in some codes.

    Any amount of help would be appreciated. Thanks!![alt text](![image url](![image url](![image url](![image url](image url)))))

  • Moderators

    @Houston Hi!
    To store on desktop (you can use other locations, see documentation for QStandardPaths):

    QString desktop = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
    int channel = 1;
    QString path = desktop + '/' + "message" + QString::number(channel) + ".wav";

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.