VGAudio Stores the configuration data needed to decode or encode an ATRAC9 stream. The 4-byte ATRAC9 configuration data. A 4-bit value specifying one of 16 sample rates. A 3-bit value specifying one of 6 substream channel mappings. An 11-bit value containing the average size of a single frame. A 2-bit value indicating how many frames are in each superframe. The channel mapping used by the ATRAC9 stream. The total number of channels in the ATRAC9 stream. The sample rate of the ATRAC9 stream. Indicates whether the ATRAC9 stream has a of 8 or above. The number of frames in each superframe. The number of samples in one frame as an exponent of 2. = 2^. The number of samples in one frame. The number of bytes in one superframe. The number of samples in one superframe. Reads ATRAC9 configuration data and calculates the stream parameters from it. The processed ATRAC9 configuration. Decodes an ATRAC9 stream into 16-bit PCM. Sets up the decoder to decode an ATRAC9 stream based on the information in . A 4-byte value containing information about the ATRAC9 stream. Decodes one superframe of ATRAC9 data. The ATRAC9 data to decode. The array must be at least . bytes long. A buffer that the decoded PCM data will be placed in. The array must have dimensions of at least [.] [.]. An Xorshift RNG used by the ATRAC9 codec The number of buffered frames waiting to be read. All buffered frames must be read before calling again. The size, in bytes, of one frame of HCA audio data. Creates and initializes a new . The encoder will be ready to accept PCM audio via . The configuration to be used when creating the HCA file. Initializes this . Any preexisting state is reset, and the encoder will be ready to accept PCM audio via . The configuration to be used when creating the HCA file. Encodes one frame of PCM audio into the HCA format. The PCM audio to encode. The array must be a jagged array of the size [ChannelCount][1024] or larger. The buffer that the encoded HCA frame will be placed in. Must be at least bytes long. The number of HCA frames that were output by the encoder. The first frame is output to . Any additional frames must be retrieved by calling before can be called again. Returns the next HCA frame awaiting output. Byte array containing the HCA frame data. The caller is given ownership of this array. Thrown when there are no frames awaiting output. A list of known keys used for encrypting HCA files. See the /docs/hca/encryption-keys.md file in this repository for a more detailed list. Scales an ATH curve to the specified frequency. The frequency to scale the curve to. The scaled ATH curve The original ATH curve is for a frequency of 41856 Hz. Represents an Absolute Threshold of Hearing (ATH) curve. This curve is used when deriving resolutions from scale factors in very old HCA versions. This curve seems to be a slight modification of the standard Painter & Spanias ATH curve formula This class contains functions used for encoding Nintendo's 4-bit ADPCM audio format. If true, trims the output file length to the set LoopEnd. If false or if the does not loop, the output file is not trimmed. Default is true. Contains the options used to build the DSP file. If true, recalculates the loop context when building the DSP. If false, reuses the loop context read from an imported DSP if available. Default is true. The number of samples in each block when interleaving the audio data in the audio file. Must be divisible by 14. Default is 14,336 (0x3800). Thrown if value is negative or not divisible by 14. When building the DSP file, the loop points and audio will be adjusted so that the start loop point is a multiple of this number. Default is 1. Defines the structure of a DSP file. The number of samples in the DSP. The number of ADPCM nibbles in the DSP. The sample rate of the audio. This flag is set if the DSP loops. The format of The address, in nibbles, of the start loop point. The address, in nibbles, of the end loop point. The address, in nibbles, of the initial playback position. The number of channels in the DSP file. Only used in multi-channel DSP files. The number of ADPCM frames in each interleaved audio data block. Only used in multi-channel DSP files. The ADPCM information for each channel. The start loop point in samples. The end loop point in samples. Size of a single channel's ADPCM audio data with padding when written to a file The number of channels in the file. The number of bytes per channel in each interleaved audio data block. The sample rate of the audio. The start loop point in samples. Will be -1 if audio doesn't loop. The end loop point in samples. The audio codec of the audio data contained in the GENH. The offset that the actual audio data starts at. The size of the GENH header. The offsets of the ADPCM coefficients for the left and right channels, respectively. The offsets of the split ADPCM coefficients for the left and right channels, respectively. The interleave type of the GENH file. Specifies how the ADPCM coefficients are stored. The ADPCM information for each channel. The number of samples in the file. This flag is set if the file loops. Flags for how the ADPCM coefficients are stored in a GENH file. Set if the ADPCM coefficients are in column-major order. Set if the ADPCM coefficients are little endian. If true, decrypts the HCA data if possible. The number of samples in the channel. The number of ADPCM nibbles in the channel. The sample rate of the audio. This flag is set if the channel loops. The address, in nibbles, of the start loop point. The address, in nibbles, of the end loop point. The address, in nibbles, of the initial playback position. Contains the options used to build the IDSP file. If true, recalculates the loop context when building the file. If false, reuses the loop context read from the imported file, if available. Default is true. The number of bytes in each block when interleaving the audio data. Must be divisible by 8. Default is 16. Thrown if value is negative or not divisible by 8. This flag is set if the file loops. The number of channels in the file. The sample rate of the audio. The start loop point in samples. The end loop point in samples. The number of samples in the file. The offset that the actual audio data starts at. The number of bytes per channel in each interleaved audio data block. The size, in bytes, of the main IDSP header. The size, in bytes, of the information for each channel in the file header. The length, in bytes, of the audio data of each channel. The ADPCM information for each channel. Size of a single channel's ADPCM audio data with padding when written to a file Size of a single channel's ADPCM audio data with padding when written to a file Size of a single channel's audio data with padding when written to a file Contains the options used to build BRSTM, BCSTM and BFSTM files. If true, rebuilds the seek table when building the file. If false, reuses the seek table read from the imported file, if available. Default is true. If true, recalculates the loop context when building the file. If false, reuses the loop context read from the imported file, if available. Default is true. The number of samples in each block when interleaving the audio data in the audio file. Must be divisible by 14. Default is 14,336 (0x3800). Thrown if value is negative or not divisible by 14. The number of samples per entry in the seek table. Used when building the audio file. Default is 14,336 (0x3800). Thrown if value is less than 2. When building the audio file, the loop points and audio will be adjusted so that the start loop point is a multiple of this number. Default is 14,336 (0x3800). The type of track description to be used when building the BRSTM header. Default is . Used only in BRSTM files. The type of seek table to use when building the BRSTM ADPC block. Default is . Used only in BRSTM files. The size of the entire file. The size of the file header. The version listed in the header. The number of blocks listed in the header. Information about the data blocks in the file. Used in BRSTM files. Information about the data blocks in the file. Used in BCSTM and BFSTM files. The audio regions in the file. Used in BCSTM and BFSTM files. Specifies whether the seek table is full length, or a truncated table used in some games including Pokémon Battle Revolution and Mario Party 8. Used in BRSTM files. The seek table containing PCM samples from throughout the audio stream. The different audio codecs used in BRSTM, BCSTM, and BFSTM files. Big-endian, 8-bit PCM. Big-endian, 16-bit PCM. Nintendo's 4-Bit ADPCM codec. The offset of the HEAD block. The size of the HEAD block as stated in the header. The offset of the ADPC block. The size of the ADPC block as stated in the header. The offset of the DATA block. The size of the DATA block as stated in the header. The different types of seek tables used in BRSTM files. A normal length, complete seek table. Used in almost all games. A shortened, truncated seek table used in games including Pokémon Battle Revolution and Mario Party 8. The different track description types used in BRSTM files. A shorter track description that does not include volume or panning values. Used in Super Smash Bros. Brawl. A track description containing all the standard values. Used in most games other than Super Smash Bros. Brawl. The reference type. Used in NW4R file formats. 0 = Address, 1 = Offset The data type of the referenced data. Used in NW4R file formats. Meaning can change between different structures. The audio codec. This flag is set if the file loops. The number of channels in the file. The number of audio regions in the file. The sample rate of the audio. The start loop point in samples. The number of samples in the file. The total count of interleaved audio data blocks. The number of bytes per channel in each interleaved audio data block. The number of samples per channel in each interleaved audio data block. The number of bytes per channel in the final interleaved audio data block, not including the padding at the end of each channel. The number of samples per channel in the final interleaved audio data block. The number of bytes per channel in the final interleaved audio data block, including the padding at the end of each channel. The number of bytes per seek table entry. The number of samples per seek table entry. The offset that the actual audio data starts at. The different audio codecs used in Wave files. 16-bit PCM. 8-bit PCM. Defines the structure and metadata of a WAVE file The number of channels in the WAVE file. The audio sample rate. The number of bits per audio sample. The number of samples in the audio file. This flag is set if the file loops. The loop start position in samples. The loop end position in samples. Defines an audio track in an audio stream. Each track is composed of one or two channels. The volume of the track. Ranges from 0 to 127 (0x7f). The panning of the track. Ranges from 0 (Completely to the left) to 127 (0x7f) (Completely to the right) with the center at 64 (0x40). The number of channels in the track. If 1, only will be used for the mono track. If 2, both and will be used. The zero-based ID of the left channel in a stereo track, or the only channel in a mono track. The zero-based ID of the right channel in a stereo track. Defines the ADPCM information for a single GC ADPCM channel. The ADPCM coefficients of the channel. The gain level for the channel. Contains the ADPCM coder context for an ADPCM sample. The predictor and scale for the current sample's frame. The first PCM history sample. (Current sample - 1). The second PCM history sample. (Current sample - 2). Creates a by reading the values from a . 3 values are read. , , and respectively. The to be read from. Must be set at the position to be read from. A 4-bit Nintendo ADPCM audio stream. The stream can contain any number of individual channels. A 16-bit PCM audio stream. The stream can contain any number of individual channels. Sets the current value of the to . The value to set. Adds to the current value of the . The amount to add. Sets the maximum value of the to . The maximum value to set. Logs a message to the object. The message to output. Specifies the bias of an offset binary value. A positive bias can represent one more positive value than negative value, and a negative bias can represent one more negative value than positive value. Example: A 4-bit offset binary value with a positive bias can store the values 8 through -7 inclusive. A 4-bit offset binary value with a positive bias can store the values 7 through -8 inclusive. Returns the floor of the base 2 logarithm of a specified number. The number whose logarithm is to be found. The floor of the base 2 logarithm of . Does a Type-4 DCT. The input array containing the time or frequency-domain samples The output array that will contain the transformed time or frequency-domain samples Does a Type-4 DCT. Intended for reference. The input array containing the time or frequency-domain samples The output array that will contain the transformed time or frequency-domain samples