Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Audio file is not available on Ubuntu mate

Audio file is not available on Ubuntu mate

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 527 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.
  • M Offline
    M Offline
    MintogoDeveloper
    wrote on last edited by
    #1

    [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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MintogoDeveloper
        wrote on last edited by
        #3

        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
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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
          1
          • sierdzioS sierdzio

            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
            
            M Offline
            M Offline
            MintogoDeveloper
            wrote on last edited by
            #5

            @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
            0

            • Login

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