PCM Ring Buffer, Psuedo Streaming.

For posting library code and examples.
Post Reply
User avatar
ahenry3068
Posts: 990
Joined: Tue Apr 04, 2023 9:57 pm

PCM Ring Buffer, Psuedo Streaming.

Post by ahenry3068 »

NOTE: ZCM is a the "Native" PCM file format for ZSMKIT, it's similiar to a WAV file but not quite the same

I've posted another Demo of this technique in DEMOSCENE viewtopic.php?t=7320
The code there is actually an update of this code.



I've written some code that can manage a ring buffer and load and play a bunch of ZCM's sequentially and seamlessly.
It's not quite the same as streaming a large file from Disk but you get the same effect. I've included a nice little background too.

Included in the SOUNDS/AMBIENCE/ Directory is all the ZCM files as well as the source .RAW file I split up and the QB64 program I used to split it. (Zerobytes raw2zcm must be in your path for the QB64 program to work properly)

To end the Demo just hit ESC. There is 21 minutes of seamless audio if you leave it play through (after which it starts over).

(The only limit with this approach is the amount of disk space available, A 3 hr or even a 10 or more hour sound track is possible).

TRYIT NOW IS PARTIALLY BROKEN. WHEN YOU GET TO THE EMULATOR LOAD "AMBIENCE.PRG" RUN

riverboat2.png
riverboat2.png (42.28 KiB) Viewed 359 times
Try It Now!


HERES THE CODE:
RIVERBOAT.zip
(9.58 MiB) Downloaded 46 times
funkheld
Posts: 268
Joined: Mon Feb 26, 2024 11:11 am

Re: PCM Ring Buffer, Psuedo Streaming.

Post by funkheld »

Hi good afternoon.
I found your program here.

it's super well made. :D :D :D
learned a lot from it.

Thanks.
greeting
Post Reply