N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

## vadpcm_enc

Syntax
vadpcm_enc -c codebook [-t] [-l minLoopLength] aifcFile codedFile

Explanation
It is an ADPCM encoder. It encodes AIFC or AIFF sound files and produces a compressed binary file that is used by the Nintendo 64 audio library. The encoding algorithm is based on a switched ADPCM algorithm which uses a codebook to define a table of prediction coefficients. Coefficients from the table are selected adaptively during encoding to give the best sound quality. The Nintendo 64 compressed sound format currently supports a single loop point that should be defined in the input file's Instrument Chunk. The codebook and loop point definitions are embedded in the final output file.
Command Line Options

- -c <filename> Defines a file that contains the prediction coefficient codebook constructed by the tabledesign tool.
- -t Truncates the encoded file after the loop end point. The portion of the sound after the loop end point is never used in audio playback.
- -l <value> Sets the minimum loop length in the encoded file (see the following Note).

Note
There is a restriction in the audio library that requires that in a single call to alAudioFrame a sound must only pass through two loop crossings. To ensure less than two loop crossings, the ADPCM encoder can stretch loops by repeating them. The currently defined default minimum loop length is 1600 samples. This default length can be changed by using a command line option. Loops shorter than the minimum loop length will be repeated until the total loop length is larger than the minimum length. In a given application, the required minimum loop length depends on the number of samples requested in a single call to alAudioFrame and the maximum pitch shift incurred by the samples. For further information, see Chapter 20, "Audio Tools," of the N64 Programming Manual.
See Also
tabledesign
vadpcm_dec

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1998