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. How to play from buffer in Phonon media player?
Forum Updated to NodeBB v4.3 + New Features

How to play from buffer in Phonon media player?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k 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.
  • adaitabeheraA Offline
    adaitabeheraA Offline
    adaitabehera
    wrote on last edited by
    #1

    I need to play an audio file present in a USB communication device. I have to read the file from remote path and update a buffer (QBuffer) and simultaneously play the file in Phonon media player where source is set as the buffer. The reading speed is much much higher than the audio file bit rate, i.e., a 10 minutes audio file (wav format: nearly 100 MB) is read with in 1-2 minutes from the remote path. But due to some reason the Phonon player cannot play the file from buffer.

    Can anybody please figure out what is going wrong here?

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

    1 Reply Last reply
    0
    • I Offline
      I Offline
      INeedMySpace
      wrote on last edited by
      #2

      You can use QAudioOuput to play audio data. It has two modes of usage. In one case copy data to some buffer and then start QAudioOutput with this buffer. You can use this in case you have all data before start. In other case starting QAudioOutput returns pointer for QIODevice which you can use to write your data while it arriving.
      P.S. In later case you can check available space in output buffer and write accordingly.

      You have been involved in illegal use of magic.

      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