Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39949

Linux: QAudioRecorder::setOutputLocation() doesn't work with QUrl::fromLocalFile()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.3.2
    • 5.1.1, 5.2.1
    • Multimedia
    • None
    • Fedora 20 + Qt 5.2.1
      SailfishOS 1.0.7 + Qt 5.1.1
    • fbd57c983d512fdc9fda81432ae28e2e9bb6d6e4

    Description

      The QAudioRecorder example and the documentation propose to setOutputLocation(QUrl::fromLocalFile()) which doesn't work on Linux. setOutputLocation() returns true but
      QAudioRecorder emits error() signal after calling record(). The
      QAudioRecorder::errorString() shows "Could not open file "file://XXXX" for writing" although it can actually be created in this location with QFile or by hands.

      strace on the program shows that the output file name is passed to syscall open() with protocol in it like this:

      open("file:///XXX", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
      

      The solution is to setOutputLocation with just QUrl("XXX"), no fromLocalFile() call.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            dpurgin Dmitriy Purgin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes