Reputation: 439
If I use the stock libmpg123 code:
while (mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK)
{
if((ao_play(dev, (char*)buffer, done)==0)){
}
}
How I can edit this for play at 2x speed, 3x speed, - 2x speed?
Upvotes: 2
Views: 510
Reputation: 13216
libmpg123 just handles the MP3 decoding. At least, I just reviewed the mpg123.h header file and didn't find anything to indicate that it would handle trick mode play. Further, I don't think libao (your selected audio output method) handles this either, based on a perusal of ao.h. I'm pretty sure you need to perform the algorithmic trickery yourself (or bring in another library to do it). Apply transforms after decoding, but before playback.
Upvotes: 3