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

QMediaPlayer don't play sound from QByteArray in macOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.9.2
    • Multimedia
    • None
    • macOS 10.12
    • macOS

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes