Skip to main content

A tool to manipulate various data, including Audio Libraries (ex CustomAudioLib.bin) for the SCOM 7330 repeater

Project description

SCOM 7330 Speech Library Tool

Unit Tests

This is a tool to manipulate Audio Libraries (such as CustomAudioLib.bin) for the SCOM 7330 repeater, reverse engineered from the provided BuildSpeechLib.exe.

The official tool, as well as default audio libraries, manuals, firmware, etc. can be found at http://www.scomcontrollers.com/7330firmware .

Speech Library Format

Remember that this is reverse engineered (so not guaranteed to be accurate), and subject to change with firmware updates

This 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:

The header and image header contain metadata and the word index is a lookup table into the data. Unused space is filled with 0xff instead of 0x00, for unclear reasons.

In the following sections, byte ranges are presented as inclusive:exclusive, like in Python. For example, 0x00:0x05 includes the bytes 0x00, 0x01, 0x02, 0x03, and 0x04. All addresses in tables are relative to the start of the section, unless stated otherwise.

Header

  • Address: 0x00
  • Length: 0x100
Byte 0x00:0x05 0x05:0x15 0x15:0x21 0x21:0x38 0x38 0x39:0x3c 0x3c:0x3d 0x3d:0x100
Value SCOM\x00 name version timestamp mode firstFree zeros (empty)
  • name, version, and timestamp are just ASCII strings, and have no apparent function beyond display.
  • mode is 3 in BuildSpeechLib.exe's normal mode, 2 in the extended arguments form. I am not sure what this means, exactly.
  • firstFree is the size of the file minus 0x100, presumably to account for this header's size. Unclear what this is used for, as it also occurs (with the 0x100 included) in the Image Header
  • zeros is two two-byte arguments to the function in BuildSpeechLib.exe which were passed in as literal zeros. Unclear function.

Image Header

  • Address: 0x100
  • Length: 0x100
Byte 0x00:0x03 0x03 0x04:0x06 0x06:0x09 0x09:0x100
Value \x00\x02\x00 index_size_mid max_word + 1 firstFree (empty)
  • I'm not sure what the purpose of the constant in 0x00:0x03 is
  • index_size_mid is the middle byte of the Word Index size. Since that size is rounded to 0x100, this is just the index size shifted down 1 byte.
  • max_word + 1 is the highest word file contained, plus one. Not really sure why it's plus one.
  • firstFree is the length of the file. Seems to be redundant with the value in the Header.

Word Index

  • Address: 0x200
  • Length: 4 times the maximum word code, rounded up to the nearest 0x100
Byte (word code * 4):(word code * 4) + 3
Value word data address

This section is a lookup table mapping the word code to the address of the entry in the Word Data section, 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 being 0xff.

Word Data

  • Address: 0x200 plus the the length of the Word Index, as stored in the Image Header.
  • Length: 3 times the number of files, plus the length of each file

For each entry:

Byte 0x00:0x03 0x03:end of file
Value end of file data address file data
  • end of file data address is the address of the end of the audio file data.
  • file data is the contents of a raw file (as per Audio Files), but with every byte greater than 127 xor'ed with 127 for some unclear reason.

Audio Files

The input/output audio files are in the format specified in the SCOM manual:

  • 8000 Hertz sampling rate
  • Single channel (mono) audio
  • μ-law encoding
  • Raw headerless file

You can convert wav files (for example) to this format with sox:

sox --type wav <input file>.wav --type ul --rate 8k <output file>.raw

or from this format to wav:

sox --type ul --rate 8k --channels 1 <input file>.raw --type wav <output file>.wav

Disclaimer

I am not affiliated with S-COM in any way. I make no guarantees of the correctness of the code. Don't break your stuff.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scom7330-0.1.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scom7330-0.1.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file scom7330-0.1.1.tar.gz.

File metadata

  • Download URL: scom7330-0.1.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.11.2-zen1-1-zen

File hashes

Hashes for scom7330-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1c9ba0474c21d5c959939dfee30fc929c85ed1b641b1c923869bd26538318044
MD5 323286bd94f0fe4ea25273e2b9439ca8
BLAKE2b-256 50084e6897e7d1d43046bdb5a0a96e7dcef4a39930807f21b4639d20310df7f9

See more details on using hashes here.

File details

Details for the file scom7330-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scom7330-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.2 Linux/5.11.2-zen1-1-zen

File hashes

Hashes for scom7330-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8711adc27bfe90908fe53c7f02e664945c08a012c1aadaa14aee78bab47ab8fd
MD5 f501c80263c423deda27fb8b6707d66e
BLAKE2b-256 93b370f6a8dbd835fee8b4214e419e4735b88f61a055358fce57506a8b5a8daa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page