Urgent question concerning sound streaming

Advanced game related topics
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by sire.

Hi,

because I am currently hunted by a tight deadline (this weekend) I would be very glad if someone could help me out with this quickly.

Matter is: I have to code a player routine for an amiga demo using an own animation format. It's going to interleave the visual data of each frame with the correspondig sound slice (as usual). Of course I want to play these slices in a manner that avoids clicks between them.

As far as I know the sound handling of the amiga hardware, there is an interrupt especially for this purpose. Every time Paula plays a memory chunk which is assigned to her through her registers, an interrupt is triggered, which leads to a routine caring for seamless continuity in the sound output, thus delivering the next appropriate set of register values.

I only have no clue how to accomplish this procedure with PBs audio command set. Anybody has a tip for me how to assure seamless merging of those sound slices? I would be tremendously grateful!

-sire

P.S.: Moreover a related question is how to calculate the exact period value PB converts out of the hertz value which it gets for the pitch with SetSoundPeriod etc. I need this value to determine the actual hertz rate which the amiga uses for the sound so that I can resample the waveform data of the sound stream to make it fit synchronously (i.e. maybe the amiga doesn't play at an exact 16 Khz but at 16.014 Hertz or so, which I would then use as the target frequency to resample the hifi sound material in Cool Edit on my PC appropriately).
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

You will probably have to play a sound in loop mode and change the buffer in realtime (stream your sound data in it)

Fred - AlphaSND
Post Reply