1

I am using using libsndfile read and manipulate sound files. I am wandering what whould be the simplest way to play these sounds in real time in Qt.

I have tried to look at QtAudioOutput, however has to use QtAudioFormat, which is quite cumbersome to configure.

All i want is to 1) Read data using libsndfile 2) manipulate the data 3) send the buffer to an audio output library.

Anton
  • 1,181
  • 2
  • 17
  • 27

2 Answers2

0

Try using sndfile-play to play audio files using libsndfile, or a library based on libsndfile such as ALURE

http://kcat.strangesoft.net/alure.html

You could load the audio file yourself manually using libsndfile and play the file using OpenAL. This is essentially what ALURE is doing.

Matt Esch
  • 22,661
  • 8
  • 53
  • 51
  • OpenAl seems a bit of an overkill for what i am trying to do. Plus installing it on different platforms doesnt seem easy. – Anton Feb 02 '12 at 22:06
  • Well I don't imagine the problem is trivial to be honest with you. OpenAL is a cross platform API that is designed to do this. Being such a widely known standard there are plenty of tutorials to get you started on it as well. I am interested to see which solution you settle on in the end, please update this question when you've done it. – Matt Esch Feb 02 '12 at 22:14
0

You can output the audio using Phonon. Here is the piece of the docu from Phonon module

The type of the source is set by the media source itself, and is dependent on the constructor used to create it. Note that it is possible to provide data from any source by implementing a QIODevice.

Basically you have to implement your own QIODevice if you want to do it Qt way

Neox
  • 2,000
  • 13
  • 12