C4 - 2007 help topic

Random Programming Tip of the Moment: Watch out for uninitialized pointers and null pointers!!! I spent 30 mins debuging my code only to find out I forgot to malloc some memory. Also free up that memory after you use it!
 
Another programming tip : never port Pascal game to C then to the Saturn 🙂 Well the aim of the topic was to help people on problems they encounter on their entries.
 
Hello,

I'm currently trying to play multiple AIF files at once from CD, using PCM library of SBL.

In the PCM manual, it's not clearly stated if I can do that with GFS or not. I tried it, it worked not. The first file was played back, after that, the second file started playing. Still, this does not proove, if it is impossible with GFS, in general.

So I tried the same with STM. The same diagnostic here, except that the second file is not played back at all, even not when the first file ended.

STM_IsComplete() reports true for the file not played back, some frames after playback started. Also, STM_ExecServer reports STM_EXEC_COMPLETED, when the file that is playing has finished.

Okay, now which of the two files is played back, depends on the order, in which STM_Open() is performed. The first file that's opened this way is played back, the second one not. All I know is that it's put into the group and STM_GetStmNum() reports that there are actually 2 STMs in the group.

In the PCM manual, there are some small notes on playing back multiple streams ot once.

Yes, I'm using the Stream library, I have assigned different PCM Stream playback numbers using PCM_SetPcmStreamNo() before playback starts, the two files are actually different files and both are uncompressed (not more than one ADPCM channel).

The remaining note that I'm not sure how to be compliant with is: I must use file interleaving or channel interleaving. WTF? The only occurance of "interleaving" is once in the STM manual, when talked about groups?

Any clue what to do for multiple audio file playback? What does file interleaving or channel interleaving mean?

Anyone else ever tried it or does there exist any demo that plays back multiple audio streams? Well, I know smppcm5.
 
No idea if it can help but for sure it wasn't possible to play audio tracks and PCM from the CD at the same time, it could be the same when you want to play 2 streams from the CD. On my Mario entry I played some PCMs from memory at the same time, for instance when you jump and get a coin, it plays the two PCMs. I did something like this :


pcm_size[0]=LoadFile("JUMP.PCM",pcm_sound[0]);

pcm_size[1]=LoadFile("COIN.PCM",pcm_sound[1]);


PcmLoad(0);

PcmLoad(1);


while(!finish)

{

PcmTask(0);

PcmTask(1);


if(..)

PcmStart(0);

if(..)

PcmStop(0);


}


It was based on smppcm5.c but you know it already 🙂
 
When reading through the GFS manual, there is the possibility to read a couple of files at once by reading only portions of each file, using GFS_NwFread().

The PCM library offers the possibility for handling buffers manually. So in theory its possible. I guess that is what is meant with interleaved file reading.

Next guess is, that STM is only needed when using interleaved channels.

Well, I was hoping that playing back multiple audio files would be easier and that the complicated stuff is done inside PCM lib.

For now, I conclude that either way, I have to implement some complicated manual buffer handling, which would enable me to load other data files while playing back audio. (Still I'd be interested to know of a simpler solution, if any exists)
 
What about dev meeting on #segaxtreme ? Sure we are not all on the same channel, Piratero & Antime are on #yabause, Charles Mac Donald is on #smspower, we got Ex-Cyber, Pinchy on #segaxtreme. Amon is both on #segaxtreme and #smspower.
 
Back
Top