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. Can not play wav file on ios

Can not play wav file on ios

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 442 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.
  • P Offline
    P Offline
    peter-70
    wrote on last edited by peter-70
    #1

    I have an adio recorder to record wav files on iOS. This works very well!
    With it I have generated an output file:

    /private/var/mobile/Containers/Data/Application/very-very-very-long-number/tmp/projectname.tmp.wav

    I have downloaded this file with xcode and played this file with Quick Time Player.
    Everything is ok and works very fine!

    Now I try desperate to play this file with a player, but everything I do, it does not work.
    For Example with qml:

    MediaPlayer {
        id: playMusic
        source: "/private/var/mobile/Containers/Data/Application/very-very-very-long-number/tmp/projectname.tmp.wav"
        volume: 70
        onError: {
            console.log(error)
        }
    }
    

    Or with C++

    QMediaPlayer player(this);
        player.setVolume(70);
    
        QMediaContent content(QUrl::fromLocalFile(fileName));
        player.setMedia(content);
        player.play();
    

    And some others more...
    Nothing do work!
    The sound is there and it works! The Quick Time Player plays it. But my players do not work.

    Do you know an realy working example?
    I guess anything is wrong with the path. But I'm not sure.

    Thanks for help!

    edit: The wav file I can open for reading with QFile::open... This works also!

    1 Reply Last reply
    0
    • ValentinMicheletV Offline
      ValentinMicheletV Offline
      ValentinMichelet
      wrote on last edited by
      #2

      Hi peter-70,

      First, for the QML part, volume attribute must take a value between 0.0 and 1.0 according to my console.
      Speaking of the console, do you get any warning message? For instance I got

      defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
      

      Which is probably a missing plugin or something.
      It would help to search on the Internet these console messages, to see if there is any topic already solved on any forum.

      Now, if you have no sound AND no messages, then I regret I won't be able to help you any further.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        peter-70
        wrote on last edited by
        #3

        The messages within the console output, could not help me yet. Thx!

        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