home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psgrain!ee.und.ac.za!shrike.und.ac.za!shrike.und.ac.za!mahlknec
- From: mahlknec@shrike.und.ac.za (Gregory Mahlknecht)
- Newsgroups: alt.sb.programmer
- Subject: Re: HELP: .wav or .voc file formats
- Date: 8 Nov 1992 22:36:40 GMT
- Organization: University of Natal (Durban), South Africa
- Lines: 239
- Message-ID: <1dk4poINNqlv@shrike.und.ac.za>
- NNTP-Posting-Host: shrike.und.ac.za
- X-Newsreader: Tin 1.1 PL4
-
- pdavies@alchemy.chem.utoronto.ca (Paul Davies) writes:
-
- >I have been looking for a document that details the .voc or .wav file
- >formats and I can't find one. If someone could tell me or at least
- >point me to a source I'd really appreciate it.
-
- >thanks,
-
- I have it all in Norton Guide format, and extracted it to a file, and here it
- is (If you have a fit of enthusiasm, you could compile it and make a norton
- Guide for yourself)...
-
- ------ CUT HERE ------
-
- !short:^BCreative Voice File (VOC) Format^B
-
- The Creative Voice file is organized into two main blocks, the Header
- Block and Data Block. The Header Block contains identifier, version number
- and pointer to the start of the Data Block.
-
- The Data Block is divided into various sub-blocks of various types such as
- Voice Data, Silence, ASCII text, Repeat and End Repeat, and Terminator.
-
- The CT-VOICE driver only processes the Data Block. It is important that
- you pass the address of the Data Block and not the Voice File when calling
- the driver to perform voice output.
-
- !short: Header Block
- ^BHeader Block^B
-
- ─────────┬─────────────────────────────────────────────────────────────────
- Offset │ Description
- ─────────┼─────────────────────────────────────────────────────────────────
- 00h-13h │ ^UFile type description.^U
- │ The following message is stored here: "Creative Voice File",1Ah
- │
- 14h-15h │ ^UOffset of Data Block from the start of the voice file^U
- │ This word points to the Data Block. It helps the application
- │ programs to locate the Data Block in case the size of header
- │ block is changed. For this version, the value here is always
- │ 1A hex.
- │
- 16h-17h │ ^UVoice file format version number^U
- │ This version number allows your program to identify different
- │ organization formats of voice data file in case of future
- │ enhancement. LSB and MSB are the minor and major version number
- │ respectively. Current version is 1.10.
- │
- 18h-19h │ ^UVoice file identification code^U
- │ This code allows your program to check that this file is a VOC
- │ file.
- │
- │ Its content is the complement of the file format version number
- │ then plus 1234 hex. For current version of 1.10, its complement
- │ (010Ah) +1234h = 1129h
- ──────────┴──────────────────────────────────────────────────────────────────
-
- !seealso: "Data Block"
-
- !short: Data Block
- ^BData Block^B
-
- The Data Block is sub-divided into multiple sub-blocks of data.
-
- a) The first byte of each sub-block is called the Block Type (BLKTYPE).
- It indicates the type of data contained in the sub-block.
-
- b) The next three bytes is the 24-bit Block Length (BLKLEN). It is the
- number of bytes in the sub-block _excluding_ the BLKTYPE and BLKLEN
- fields. Only the Terminator sub-block does not have a BLKLEN field.
-
- c) Depending on BLKTYPE, the rest of the data in the sub-block may be
- voice attributes (such as sampling rate and packing), voice data or
- other information (such as Marker and ASCII text).
-
- Your program needs not interpret all the BLKTYPE. For those BLKTYPEs it
- does not recognizem it can move to next sub-block based on the BLKLEN
- easily. In most of the applications, your program can simply pass the
- address of the Data Block to the CT-VOICE driver which will interpret the
- Voice file and perform the output accordingly.
-
- !seealso: "Header Block" "Type 0"
-
- !short: Type 0 Terminator
- ^BType 0 : Terminator^B
-
- ┌────┐
- │ 00 │
- └────┘
-
- This 1-byte sub-block terminates the entire Data Block. It indicates that
- there is no other sub-block after it. CT-VOICE driver terminates voice
- output when this BLKTYPE is encountered.
-
- This BLKTYPE must be the last block in the voice file.
-
- !seealso: "Type 4"
-
- !short: Type 1 Voice Data
- ^BType 1 : Voice Data^B
-
- ┌────┬──┬──┬──┬────┬──────┬─----------─┐
- │ 01 │ BLKLEN │ SR │ PACK │ VOICE DATA │
- └────┴──┴──┴──┴────┴──────┴─----------─┘
-
- This BLKTYPE indicates that this sub-block is a new set of voice data. It
- may use different sampling rate or packing method.
-
- The SR field(1 byte) is the Sampling Rate. It is defined as
-
- SR = 256 - 1000000/sampling rate
-
- For instance, if the sampling rate is 10,000 Hz, SR is set to 156.
-
- The PACK field (1 byte) is the Packing method used for this sub-block of
- voice data. It is defined as:
-
- ╔══════╤════════════════════════╗
- ║ PACK │ Description ║
- ╠══════╪════════════════════════╣
- ║ 0 │ 8-bit raw or unpacked ║
- ║ 1 │ 4-bit packed ║
- ║ 2 │ 2.6-bit packed ║
- ║ 3 │ 2-bit packed ║
- ╚══════╧════════════════════════╝
-
- The voice data length is calculated as follows:
-
- voice data length = BLKLEN - 2
-
- !seealso: "Type 2"
-
- !short: Type 2 Voice Continuation
- ^BType 2 : Voice Continuation^B
-
- ┌────┬──┬──┬──┬─----------─┐
- │ 02 │ BLKLEN │ VOICE DATA │
- └────┴──┴──┴──┴─----------─┘
-
- This sub-block is a continuation of the voice data from the last Voice
- Data sub-block.
-
- The length of the voice data is BLKLEN.
-
- !seealso: "Type 1"
-
- !short: Type 3 Silence
- ^BType 3 : Silence^B
-
- ┌────┬──┬──┬──┬───┬───┬────┐
- │ 03 │ BLKLEN │ PERIOD│ SR │
- └────┴──┴──┴──┴───┴───┴────┘
-
- This sub-block defines silence period in the voice data.
-
- The length of the silence period (period, 2 bytes) is stored after the
- BLKLEN field in units of sampling cycle. Its value is one less than the
- silence period. The sampling rate (SR) is defined as above.
-
- The BLKLEN for this sub-block is always 3.
-
- !seealso: "Type 1" "Type 2" "Type 0"
-
- !short: Type 4 Marker
- ^BType 4 : Marker^B
-
- ┌────┬──┬──┬──┬───┬───┐
- │ 04 │ BLKLEN │ MARKER│
- └────┴──┴──┴──┴───┴───┘
-
- This is a special sub-block that specifies a Marker (MARKER, 2 bytes) in
- the voice data.
-
- During voice output, the CT-VOICE driver updates the status word
- ct_voice_status with this marker value. Your program may check for the
- desired MARKER value to perform synchronization with the voice output
- process.
-
- The Marker value must be within the range of 1 to 0FFFE hex. Note that 0
- and FFFF hex are reserved by the CT-VOICE driver. Also refer to the
- following section Essentials of using the CT-VOICE driver.
-
- The BLKLEN field is always set to 2.
-
- !seealso: "Type 5"
-
- !short: Type 5 ASCII Text
- ^BType 5 : ASCII Text^B
-
- ┌────┬──┬──┬──┬──--------──┬──────┐
- │ 05 │ BLKLEN │ ASCII DATA │ NULL │
- └────┴──┴──┴──┴──--------──┴──────┘
-
- This sub-block specifies a null-terminated ASCII string in the voice data
- file.
-
- Most programs choose to ignore this BLKTYPE. It is defined for a program
- which requires ASCII information on the voice such as name, type or
- remarks on the voice data.
-
- !seealso: "Type 4"
-
- !short: Type 6 Repeat Loop
- ^BType 6 : Repeat Loop^B
-
- ┌────┬──┬──┬──┬───┬───┐
- │ 06 │ BLKLEN │ COUNT │
- └────┴──┴──┴──┴───┴───┘
-
- This sub-block specifies the beginning of a repeat loop. The data
- sub-blocks between this block and the next End-Repeat Loop sub-block is
- repeated by the CT-VOICE driver for (COUNT+1) times.
-
- The COUNT (2 bytes) field takes a value from 1 to FFFE hex as a loop
- count. If COUNT is FFFF hex, then it is to be an endless loop. In this
- case, refer to the following section Reference fir SBC Voice functions on
- how to break out of the endless loop.
-
- The BLKLEN field is always 2.
-
- !seealso: "Type 7"
-
- !short: Type 7 End Repeat Loop
- ^BType 7 : End Repeat Loop^B
-
- ┌────┬──┬──┬──┐
- │ 07 │ BLKLEN │
- └────┴──┴──┴──┘
-
- This sub-block specifies the end of a Repeat Loop. Refer to Block Type 6
- for details.
-
- The BLKLEN field is always 0.
-
- !seealso: "Type 6"
-
- --------- CUT HERE -------
-
- - Greg
-