Stream sound file over network



  • Hey everybody,

    I'm trying to open a sound file (e.g. mp3 or ogg vorbis) and stream it over the network to a client (such as VLC, which can play network streams).

    I already got a file playing with QMediaPlayer (which is ridicilously easy), but cannot figure out how to get a data stream from this.

    QAudioInput on the other hand provides some kind of streaming (which I didn't yet fully understand), but seems to take only AudioDevices as input, no files.

    All in all I have the impression that I'm going at this all wrong, so if there is some QMultimedia guru reading this, please be so kind to point me in the right direction.

    Cheers
    PhoeNox


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Just to be sure I understand you correctly, are you trying to build a streaming server for local files ?



  • Just to be sure I understand you correctly, are you trying to build a streaming server for local files ?

    I guess it's best if I give you a bit more context:
    In the long run, the goal is to develop an application where the user can mix multiple sound files together and stream them, so a client can listen in on this stream.
    For this, the UI will have multiple buttons, each associated with a sound file. If the user presses a button, the corresponding sound is "played", either via a normal audio playback device or sent to a stream. If the user selects multiple sounds, they should be mixed together.

    But for the sake of simplicity, I want to limit this topic to the converting of a sound file to an audio stream that a client can listen on. My hope is that I can figure out the rest myself once I get my bearings.


  • Lifetime Qt Champion

    Then I'd recommend using a dedicated library to do that. Qt already uses GStreamer for it's backend on Linux so that might be a possibility. You also have the QtGstreamer module that can help with that.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.