Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-65063

QMediaPlayer don't play sound from QByteArray in macOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.9.2
    • Fix Version/s: None
    • Component/s: Multimedia
    • Labels:
      None
    • Environment:
      macOS 10.12
    • Platform/s:
      macOS

      Description

      This is my code :

      QFile file("sound.mp3");
      file.open(QIODevice::ReadOnly);
      QByteArray arr = file.readAll();
      QMediaPlayer *player = new QMediaPlayer(this);
      QBuffer *buffer = new QBuffer(player);
      buffer->setData(arr);
      buffer->open(QIODevice::ReadOnly);
      player->setMedia(QMediaContent(),buffer);
      player->play();
      

      This code work in windows fine but in macOS sound don't play, i can just play sound from file in macOS

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              ylopes Yoann Lopes
              Reporter:
              ARASHz4 Arash
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes