Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Audio file is not available on Ubuntu mate

    General and Desktop
    2
    5
    330
    Loading More Posts
    • 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.
    • M
      MintogoDeveloper last edited by

      [0_1552374208953_Alarm01.wav](Uploading 100%)

      Above audio file is from windows media.

      This file is available on Windows but, on ubuntu mate (arm64), this is not available on Qt QMediaPlayer api.

      It display [Warning: "Could not get/set settings from/on resource."]

      Is there anybody knows reson?

      Platform : Arm64 (Odroid C2)
      OS : Ubuntu mate 18.04
      Qt : 5.9.5

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Please share the code you're using to access/ play the file.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • M
          MintogoDeveloper last edited by

          Here is parts of my code to play wave file.

          MediaPlayer
          {
          id: soundPlayer

              loops: 0
          
              property bool isReadyToPlay: true
          
              property string completeSoundSrc: "qrc:/controls/sounds/Alarm01.wav"
          
              Component.onCompleted:
              {
                  soundPlayer.volume = 1.0
                  soundPlayer.source = ""
              }
          
              onPlaying:
              {
                  soundPlayer.isReadyToPlay = false
              }
          
              onStopped:
              {
                  soundPlayer.isReadyToPlay = true
              }
          
              function setVolume(volume)
              {
                  if (volume > 1.0)
                  {
                      soundPlayer.volume = 1.0
                  }
                  else if (volume < 0.0)
                  {
                      soundPlayer.volume = 0.0
                  }
                  else
                  {
                      soundPlayer.volume = volume
                  }
              }
          
              function playCompleteSound()
              {
                  if (soundPlayer.isReadyToPlay === true)
                  {
                      soundPlayer.source = soundPlayer.completeSoundSrc
                      soundPlayer.play()
                  }
              }
          }
          
          Button
          {
              width: 50
              height: 50
              
              onButtonClicked:
              {
                  soundPlayer.playCompleteSound()
              }
          }
          
          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            You have that Alarm01.wav file compiled into application's resources, right?

            Maybe check if wav is supported using https://doc.qt.io/qt-5/qmediaplayer.html#hasSupport.

            Plus, make sure you have all Qt's dependencies, for example by running:

            sudo apt build-dep qt5-qmake
            

            (Z(:^

            M 1 Reply Last reply Reply Quote 1
            • M
              MintogoDeveloper @sierdzio last edited by

              @sierdzio

              After I converted it to mp3 file, It available to play on Qt.
              But [Warning: "Could not get/set settings from/on resource."] message is still showing..

              and I already running that command line command :(

              1 Reply Last reply Reply Quote 0
              • First post
                Last post