raw2zcm, GUI implementation.

Post Reply
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

raw2zcm, GUI implementation.

Post by ahenry3068 »

MAY 9TH 2024 added version 2.0 with HUGE ZCM support.

Implemented raw2zcm in QB64 with a GUI interface. This converts a raw audio file created with Audacity, ffmpeg or other tool to the PCM audio file format used by ZSMKIT. A ZCM file.

Linux Executable and QB64(PE) Source. The source needs tweaked a little to properly function under Windows.


DOWNLOAD
RAW2ZCM.zip
(368.59 KiB) Downloaded 121 times

13 APR 24
ADDED WINDOWS DEFINES
(Also conversion time in Linux was so fast so I didn't have any progress indicator code. It's probably because I'm running Windows in a VM that the conversion takes a few seconds for me on Windows. So I added progress indicator code. (just printing a "." every 1024 bytes). Chances are this will run just as fast on NATIVE Windows as it does on Linux. If you want to strip the progress code out it's only one line of code in the SUB Write_ZCMFile )
RAW2ZCM-W.zip
(1 MiB) Downloaded 124 times


Explanation of HUGE ZCM viewtopic.php?p=33409#p33409
(Windows and Linux versions included)
VERSION 2.0 (Creates HUGE ZCM files)
RAW2ZCM2.zip
(7.97 MiB) Downloaded 69 times


For anyone interested in using QB64 I leave the following note.

CHANGED: SLASH$="/" TO $If WINDOWS Then SLASH$ = "\" $Else SLASH$ = "/" $End If

That was the only code change to compile this program properly under both Linux & Windows. I only needed this because I'm parsing filenames and paths, If I wasn't doing that I would not have even needed that change.
Last edited by ahenry3068 on Thu May 09, 2024 8:27 pm, edited 7 times in total.
User avatar
ahenry3068
Posts: 1134
Joined: Tue Apr 04, 2023 9:57 pm

Re: raw2zcm, GUI implementation.

Post by ahenry3068 »

Created a new version with HUGE ZCM support.

I'm releasing a new version of RAW2ZCM. This will do ""HUGE"" ZCM files for streaming. The standard ZCM format by ZeroByte has the following 8 byte Header

Pointer : 16 bit unsigned integer Bank : 8 bit unsigned integer Audio_Data_Size : 24 bit unsigned integer VERA_Cfg : 8 bit unsigned integer VERA_Rate: 8 bit unsigned integer

A 24 bit integer for Audio size allows up to a value of 16 megabytes. My new version will output this header for any file with 16 mb's of Audio Data or less. Zerobytes raw2zcm truncated at 2mb, I guess because he wanted to be able to fully load all files into BRAM. My original raw2zcm doesn't truncate and allowed Audio files up to 16 mb's in size. If streaming Audio from disc you might want larger data than 16 mb's to do this my new release can switch to a HUGE mode that will allow the ZCM file to be up to 4gb's in size. It will prompt the user before doing this to ask for permission. If the user declines the file will be truncated at 16mb's and retain the original ZCM Header. If HUGE mode is allowed the Header format is changed, It will still be 8 bytes in size.

HUGE ZCM HEADER HUGE_Id : 16 bit ALWAYS $FFFF Audio_Data_Size : 32 bit unsigned integer VERA_Cfg : 8 bit unsigned integer VERA_Rate: 8 bit unsigned integer

In both cases the Header is immediately followed by raw PCM audio data that is described by VERA_Cfg & VERA_Rate. (ref VERA programmers reference).
Post Reply