Simple cross-platform free audio library for raw PCM?

I am writing a Qt-based cross-platform program that from time to time should play sound delivered externally (out of my control) as raw PCM. The exact format is a 16-bit low-intensity PCM at various sample rates.

My first obvious idea was to use Qt's own Phonon to play sound, but there are two problems with this approach:

  • As far as I understand, Phonon does not support headerless PCM data. I would have to hack this and fake the WAV header every time I start playback. However, this is not a show.
  • More importantly: there seems to be no way to control how the Phonon (and its backend, such as xine, PulseAudio, DirectX, any) prebuffers. Its default behavior is like something like 5 seconds of pre-buffering, which is too much for me. I would prefer about 1 second, and I would definitely like to be able to control this!

I am currently watching Gstreamer, FFMPEG and libvlc. Any suggestions? Since my sound is in a very simple format, and I don’t need to make fancy mixing material (just a volume control), I would like a simple , free (as in the case of freedom), cross-platform and widely accessible library.

+3
source share
3

Qt 4.6 QtMultimedia.

https://doc.qt.io/archives/4.6/qtmultimedia.html

QAudioOutput, , , - PCM.

+5

ffmpeg, libvlc gstreamer raw pcm, .

SDL ( 1, 2), OpenAL, QAudioOutput. SDL, , .

, ? .

+3
+1

Source: https://habr.com/ru/post/1731763/


All Articles