Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.1.1, 5.2.1
-
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.