libmad and pcm output

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jellybeast
Posts: 2
Joined: Sat Sep 02, 2006 1:23 pm

libmad and pcm output

Post by jellybeast »

Greetings,

I've been getting my feet wet with the psp toolchain and have built some test apps successfully. I'm aiming to build an mp3 player with audio book friendly features. I've been experimenting with libmad and I'm able to successfully load and play some test files.

I'm running into issues though when I try to play my low bitrate (audio book) mp3s. They play too fast. I have seen mention of this before in a couple of other locations, but no definitive answer. Anyhow, this being my first experience with audio encoding/decoding I'm a little confused about something: Can someone tell me if the PCM output from libmad needs to be at a certain bitrate or if it's interpreted by the PSP as a certain khz? Meaning, does the PSP expect the PCM samples to be in some certain format (e.g. at a specific rate or stereo/mono)? Do I need to up or down covert it maybe?

If I'm not phrasing the question correctly please excuse me (and correct) - as I said I'm new to audio programming and the associated terminology.

Thanks!
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

The PSP can only handle 44100Hz samples, so if your media is a different sampling rate, you'd need to convert it. For 22050Hz simple sample doubling is enough, for other bitrates you'd probably need a better interpolation approach.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
jellybeast
Posts: 2
Joined: Sat Sep 02, 2006 1:23 pm

Post by jellybeast »

Raphael wrote:The PSP can only handle 44100Hz samples,
Thanks! I'm assuming 44100Hz stereo - correct?
siberianstar
Posts: 70
Joined: Thu Jun 22, 2006 9:24 pm

Post by siberianstar »

Yes, for mono just give the same sample two times.
Post Reply