<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[no Audio in QML on iOS]]></title><description><![CDATA[<p dir="auto">I'm using Qt 5.12.4 (and Xcode 11) and have the following QML</p>
<pre><code>import QtQuick 2.12
import QtQuick.Window 2.12
import QtMultimedia 5.8

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Audio {
        id: audio
        loops: Audio.Infinite
        onStatusChanged:        console.log("status = " + status)
        onError:                console.log("error = " + error + " " + errorString)
        onPlaybackStateChanged: console.log("playbackstate = " + playbackState)
        source: "qrc:/sounds/audio.mp3"
        volume: 1.0
    }
    Component.onCompleted: audio.play()
}
</code></pre>
<p dir="auto">I have a <code>sounds</code> subdirectory at the same level as my .pro file and I have added <code>sounds/audio.mp3</code> to the qrc.  This works fine on eg Linux and Mac. When running this application on an actual iPhone, I see the following loglines</p>
<pre><code>QML debugging is enabled. Only use this in a safe environment.
qml: status = 2
stale focus object QObject(0x0) , doing manual update
qml: playbackstate = 1
qml: status = 6
qml: status = 7
qml: status = 3
qml: playbackstate = 0
qml: status = 6
qml: playbackstate = 1
qml: status = 7
...
</code></pre>
<p dir="auto">so it seems that the file is found and played back correctly.  However, I can hear nothing at all.  Other apps on my Phone do play sounds.</p>
<p dir="auto">I've also tried using a construct like in my *.pro file as suggested <a href="https://forum.qt.io/topic/101689/audio-files-don-t-play-in-qml-app-on-iphone/11">here</a></p>
<pre><code>SOUND_FILES = ./sounds/audio.mp3
ios {
  sound.files = $$SOUND_FILES
  sound.path = sounds
  QMAKE_BUNDLE_DATA = sound
}
</code></pre>
<p dir="auto">but by doing so, I always got <code>qml: error = 1 Attempting to play invalid Qt resource</code> (I tried /sounds/audio.mp3, sounds/audio.mp3, audio.mp3)</p>
<p dir="auto">Any ideas? A working example maybe?</p>
]]></description><link>https://forum.qt.io/topic/107297/no-audio-in-qml-on-ios</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 04:44:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/107297.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Sep 2019 10:38:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to no Audio in QML on iOS on Mon, 30 Sep 2019 18:07:10 GMT]]></title><description><![CDATA[<p dir="auto">Solved: see <a href="https://forum.qt.io/topic/107325/ios-no-audio-when-mute-switch-is-on-other-apps">https://forum.qt.io/topic/107325/ios-no-audio-when-mute-switch-is-on-other-apps</a></p>
]]></description><link>https://forum.qt.io/post/553660</link><guid isPermaLink="true">https://forum.qt.io/post/553660</guid><dc:creator><![CDATA[Marc_Van_Daele]]></dc:creator><pubDate>Mon, 30 Sep 2019 18:07:10 GMT</pubDate></item></channel></rss>