Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qml Audio no sound on iOS
Forum Updated to NodeBB v4.3 + New Features

Qml Audio no sound on iOS

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 3 Posters 620 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senmx
    wrote on last edited by senmx
    #1

    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

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • S Offline
      S Offline
      senmx
      wrote on last edited by
      #6
      This post is deleted!
      1 Reply Last reply
      0
      • S senmx

        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

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @senmx said in Qml Audio no sound on iOS:

        Audio {
        ...
        }

        I doubt you will get a meaningfull answer with that amount of information...

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply
        0
        • S senmx

          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

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #3

          @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


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          S 1 Reply Last reply
          0
          • jsulmJ jsulm

            @senmx said in Qml Audio no sound on iOS:

            Audio {
            ...
            }

            I doubt you will get a meaningfull answer with that amount of information...

            S Offline
            S Offline
            senmx
            wrote on last edited by senmx
            #4

            @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
            
            1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              @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

              S Offline
              S Offline
              senmx
              wrote on last edited by senmx
              #5

              @J-Hilk No sound in all formats.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                senmx
                wrote on last edited by
                #6
                This post is deleted!
                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved