mrcrowbar.lib.audio.voc module

File format classes for the Creative Voice audio format.

Sources: http://www.shikadi.net/moddingwiki/VOC_Format

class mrcrowbar.lib.audio.voc.VOC(*args, **kwargs)[source]

Bases: mrcrowbar.blocks.Block

audio_chunk
checksum
chunks
header_size
magic
version
class mrcrowbar.lib.audio.voc.VOCCodec[source]

Bases: enum.IntEnum

An enumeration.

ADPCM_CREATIVE_2_8 = 3
ADPCM_CREATIVE_3_8 = 2
ADPCM_CREATIVE_4_8 = 1
PCM_ALAW = 6
PCM_INT16 = 4
PCM_UINT8 = 0
PCM_ULAW = 7
class mrcrowbar.lib.audio.voc.VOCExtra(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
channels
channels_raw
codec
freq_divisor
sample_rate
class mrcrowbar.lib.audio.voc.VOCMarker(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
value
class mrcrowbar.lib.audio.voc.VOCRepeatEnd(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
class mrcrowbar.lib.audio.voc.VOCRepeatStart(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
count
count_raw
class mrcrowbar.lib.audio.voc.VOCSilence(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
freq_divisor
length
length_raw
sample_rate
class mrcrowbar.lib.audio.voc.VOCSoundData(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
data
class mrcrowbar.lib.audio.voc.VOCSoundData12(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
channels
channels_raw
codec
data
reserved
sample_bits
sample_rate
class mrcrowbar.lib.audio.voc.VOCText(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
text
class mrcrowbar.lib.audio.voc.VOCTypedSoundData(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]

Bases: mrcrowbar.blocks.Block

Base class for Blocks.

source_data
Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
parent
Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
preload_attrs
Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
endian
Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
cache_bytes
Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
path_hint
Cache a string containing the path of the current Block, relative to the root.
strict
Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
cache_refs
Pre-cache all the Refs. Defaults to True.
codec
data
freq_divisor
sample_rate
sample_width
signedness