views:

232

answers:

2

Hey,

I was wondering, what was a good cross-platform utility for doing audio recording/ playback/ seeking in C++? I was thinking going the route of ALUT (OpenAL), but is there a better way? If not, do you guys know of any good tutorials/sample code for ALUT?

A: 

Qt actually has some audio functions since version 4.6.

Didn't try the input for myself, but if you scroll down a bit in the Qt-Documentation there is a basic example.

For Input you can work a layer higher with Qt. Here is an example.

eL
It would be nice if it was independent of Qt?
Cenoc
As you're going to use a library anyway - what's the problem with Qt?
eL
Well, I cant find a seek function? I guess that's one issue.
Cenoc
Editted my answer for seeking reasons.
eL
The phonon library, as far as I know, only plays only structured files with codecs, not PCM... if there was a way of converting from PCM to a usable codec, that'd be fine, I suppose.
Cenoc
@Cenoc: you could use the ffmpeg command line tool to convert these files, or use the libavcodec library ffmpeg uses internally directly.(supported formats: http://ffmpeg.org/general.html#SEC3)
smerlin
A: 

SFML and SDL have support for playing many different sound formats and are cross plattform. Neither of them provides you with means for recording audio. Then there is PortAudio which looks pretty active but I do have no experience with it at all.

pmr
Apparently they recently added audio recording capabilities to OpenAL (according to the documentation), not sure how good that is.
Cenoc
@Cenoc, thank you. Apparently I should have look at the implementation instead of relying on mailing list posts. Editet.
pmr
PortAudio turned out to be pretty good, by the way. (I tried the Qt audio support, which was too little, OpenAL, which was too much, and PortAudio was just right).
Cenoc