Package: scom7330
SCOM 7330 Speech Library ToolThis is a tool to manipulate Audio Libraries (such asCustomAudioLib.bin) for the SCOM 7330 repeater, reverse engineered
from the providedBuildSpeechLib.exe.The official tool, as well as default audio libraries, manuals,
firmware, etc. can be found athttp://www.scomcontrollers.com/7330firmware.Speech Library FormatRemember that this is reverse engineered (so not guaranteed to be
accurate), and subject to change with firmware updatesThis was derived from firmware release V1.8b,
BuildSpeechLib.exe V1.2.0 (built 5/13/2018)The speech library file is composed of 4 sections:Header(0x100bytes)Image Header(0x100bytes)Word Index(variable length, rounded up to the nearest0x100)Word Data(variable length)The header and image header contain metadata and the word index is a
lookup table into the data. Unused space is filled with0xffinstead
of0x00, for unclear reasons.In the following sections, byte ranges are presented asinclusive:exclusive, like in Python. For example,0x00:0x05includes the bytes0x00,0x01,0x02,0x03, and0x04. All
addresses in tables are relative to the start of the section, unless
stated otherwise.HeaderAddress:0x00Length:0x100Byte0x00:0x050x05:0x150x15:0x210x21:0x380x380x39:0x3c0x3c:0x3d0x3d:0x100ValueSCOM\x00nameversiontimestampmodefirstFreezeros(empty)name,version, andtimestampare just ASCII strings, and have
no apparent function beyond display.modeis 3 inBuildSpeechLib.exe's normal mode, 2 in the extended
arguments form. I am not sure what this means, exactly.firstFreeis the size of the file minus0x100, presumably to
account for this header's size. Unclear what this is used for, as it
also occurs (with the0x100included) in theImage Headerzerosis two two-byte arguments to the function inBuildSpeechLib.exewhich were passed in as literal zeros. Unclear
function.Image HeaderAddress:0x100Length:0x100Byte0x00:0x030x030x04:0x060x06:0x090x09:0x100Value\x00\x02\x00index_size_midmax_word + 1firstFree(empty)I'm not sure what the purpose of the constant in0x00:0x03isindex_size_midis the middle byte of theWord Indexsize. Since that size is rounded to0x100, this is just the index
size shifted down 1 byte.max_word + 1is the highest word file contained, plus one.
Not really sure why it's plus one.firstFreeis the length of the file.
Seems to be redundant with the value in theHeader.Word IndexAddress:0x200Length: 4 times the maximum word code, rounded up to the nearest0x100Byte(word code * 4):(word code * 4) + 3Valueword data addressThis section is a lookup table mapping the word code to the address of
the entry in theWord Datasection, relative to the file
start. All un-used entries are blank (0xff). Each entry is 4 bytes
long, but the address is stored just in the first 3 bytes (with the
last one being0xff.Word DataAddress:0x200plus the the length of theWord Index,
as stored in theImage Header.Length: 3 times the number of files, plus the length of each fileFor each entry:Byte0x00:0x030x03:end of fileValueend of file data addressfile dataend of file data addressis the address of the end of the audio file data.file datais the contents of a raw file (as perAudio Files), but with every byte greater than 127 xor'ed
with 127 for some unclear reason.Audio FilesThe input/output audio files are in the format specified in the SCOM manual:8000 Hertz sampling rateSingle channel (mono) audioμ-law encodingRaw headerless fileYou can convert wav files (for example) to this format withsox:sox--typewav<inputfile>.wav--typeul--rate8k<outputfile>.rawor from this format to wav:sox--typeul--rate8k--channels1<inputfile>.raw--typewav<outputfile>.wavDisclaimerI am not affiliated with S-COM in any way. I make no guarantees of the
correctness of the code. Don't break your stuff.