Qml Audio no sound on iOS
-
Can play in the emulator or Android.
import QtQuick 2.12 import QtQuick.Window 2.12 import QtMultimedia 5.15 Window { width: 640 height: 480 visible: true Text { id: title anchors.centerIn: parent text: "Click Me!"; horizontalAlignment: Text.AlignHCenter font.pointSize: 24; width: 150; height: 50; Audio { id: playMusic source: "https://xxx.com/xxx.mp3" } MouseArea { id: playArea property int st: 0 anchors.fill: parent onPressed: { if(st == 0) { st = 1; title.text = "play"; playMusic.play(); } else { st = 0; title.text = "stop"; playMusic.pause(); } } } } }version:
Qt 5.14.2 /5.15.2 for iOS
Mac OS 10.13.6/10.15.7
xcode10.1/12 -
Can play in the emulator or Android.
import QtQuick 2.12 import QtQuick.Window 2.12 import QtMultimedia 5.15 Window { width: 640 height: 480 visible: true Text { id: title anchors.centerIn: parent text: "Click Me!"; horizontalAlignment: Text.AlignHCenter font.pointSize: 24; width: 150; height: 50; Audio { id: playMusic source: "https://xxx.com/xxx.mp3" } MouseArea { id: playArea property int st: 0 anchors.fill: parent onPressed: { if(st == 0) { st = 1; title.text = "play"; playMusic.play(); } else { st = 0; title.text = "stop"; playMusic.pause(); } } } } }version:
Qt 5.14.2 /5.15.2 for iOS
Mac OS 10.13.6/10.15.7
xcode10.1/12@senmx said in Qml Audio no sound on iOS:
Audio {
...
}I doubt you will get a meaningfull answer with that amount of information...
-
Can play in the emulator or Android.
import QtQuick 2.12 import QtQuick.Window 2.12 import QtMultimedia 5.15 Window { width: 640 height: 480 visible: true Text { id: title anchors.centerIn: parent text: "Click Me!"; horizontalAlignment: Text.AlignHCenter font.pointSize: 24; width: 150; height: 50; Audio { id: playMusic source: "https://xxx.com/xxx.mp3" } MouseArea { id: playArea property int st: 0 anchors.fill: parent onPressed: { if(st == 0) { st = 1; title.text = "play"; playMusic.play(); } else { st = 0; title.text = "stop"; playMusic.pause(); } } } } }version:
Qt 5.14.2 /5.15.2 for iOS
Mac OS 10.13.6/10.15.7
xcode10.1/12@senmx said in Qml Audio no sound on iOS:
Android
are you using one of the supported audio formats ?
https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html -
@senmx said in Qml Audio no sound on iOS:
Audio {
...
}I doubt you will get a meaningfull answer with that amount of information...
@jsulm It is omitted because it should not be a problem of use. The same code is fine in Android. The audio format is mp3.
onStatusChanged { if($log.isDebug()) { $log.debug("player status " + status); } //The normal playback status has been printed out here, but there is no sound. }[DEBUG] 2021-07-01 09:11:56 [107042b80] player status 2 [DEBUG] 2021-07-01 09:12:00 [107042b80] player status 6 [DEBUG] 2021-07-01 09:12:22 [107042b80] player status 4 [DEBUG] 2021-07-01 09:12:36 [107042b80] player status 6 [DEBUG] 2021-07-01 09:13:01 [107042b80] player status 4 [DEBUG] 2021-07-01 09:13:17 [107042b80] player status 6 [DEBUG] 2021-07-01 09:13:31 [107042b80] player status 4 [DEBUG] 2021-07-01 09:13:33 [107042b80] player status 6 [DEBUG] 2021-07-01 09:13:51 [107042b80] player status 7 [DEBUG] 2021-07-01 09:13:51 [107042b80] player status 1 -
@senmx said in Qml Audio no sound on iOS:
Android
are you using one of the supported audio formats ?
https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/CoreAudioOverview/SupportedAudioFormatsMacOSX/SupportedAudioFormatsMacOSX.html