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. QMediaPlayer eats the initial part of audio files
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer eats the initial part of audio files

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qmultimediaqmediaplayeraudiobufferdelay
2 Posts 2 Posters 1.3k Views 1 Watching
  • 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
    Mark81
    wrote on last edited by
    #1

    Please, consider this short piece of code:

    QMediaPlayer *m_player = new QMediaPlayer(this, QMediaPlayer::LowLatency);
    m_player->setMedia(QUrl::fromLocalFile(filename));
    m_player->play();
    

    It plays a standard wave file (mono, 16 bit, 16 kHz) but you can't hear the first half of second of the audio. I need to play sound effects, which have a very short duration... is there a way to avoid QMediaPlayer "eating" the first part of the audio?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Usually, to play sound effect, the QSoundEffect class is used. Wouldn't that fill your need ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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