Only 16-bit PCM output can be played?

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

Moderators: cheriff, TyRaNiD

Post Reply
Gan Quan
Posts: 5
Joined: Mon Sep 18, 2006 6:42 pm

Only 16-bit PCM output can be played?

Post by Gan Quan »

I'm working on my mp3 player recently, but I have no experience with audio programming before, so I did a bit of research on available open sourced media players for PSP. After several hours of learning, I started to get some clues, and (with code from here and there) I finished a demo program to play mp3 files. It works very well, but still, there are somethings confused me:

1. My little demo program uses libmad to decode mp3 files, which uses 32-bit integers to represent PCM samples, the PCM samples are rounded to 16-bit shorts before feeded to pspAudioSetChannelCallback() function. I know there are different formats of PCM output, 8-bit, 16-bit, 24-bit, 32-bit, etc... but from the source code I've read so far, every media player on PSP did this conversion, does this mean that PSP can handle only 16-bit PCM output?

2. How much does this conversion would effect on the sound quality of the playback, in spite of the quality of the mp3 file? Currently I'm using a modified version of madplay's audio_linear_dither() [line 237] function to do the conversion.

3. Is pspAudioInit(), pspAudioSetChannelCallback(), ..., the best way to make PSP play music? Or, are there other ways to do so?

Thanks and I'm sorry if I'm asking silly questions.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

the psp supports up to 32bit PCM
so you must fill your samples twice
if your using 16bit
10011011 00101010 11010111 10001001 10111010
Post Reply