Wave Index Player
About This Guide
This application note describes the Wave Index Player and Wave Index Vector modules in AudioWeaver and demonstrates its uses.
The Wave Index Player module executes the WAV playback using index vector as pitch factor input. The module plays out the .wav file in a loop mode and takes an input stream or vector as sample index input. The module can be found in Sound Design->WavePlayer-> Wave Index Player in the Module Bar on the left-hand side of the AudioWeaver Designer.
![](../../__attachments/3037692263/att_11_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 1: Wave Index Player module location
Module Functional Description
The Wave Loop Player module is wav file player. This module has three different variants.
Wave Index Vector
Wave Index Player RAM
Wave Index Player FFS
Wave Index Vector
The Wave Index Vector module is used in the case of a common index vector or looping wave player. This module computes the common sample index vector based on the greatest common divisor of all wave files. Computes a sample index vector table which is common for a group of wave players which need to be in sync to each other.
![](../../__attachments/3037692263/att_1_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Input/Output Pins:
The Wave Index Vector has one input and one output pin.
Ratio input pin can be either .fRatio or .RPM dependent on the useRPM argument.
Index output pin gives a synced sample index of the computed vector table which is common for a group of wave players.
Variables:
The variables are the first tab in Module properties which is Rt Click on the module View Properties.
![](../../__attachments/3037692263/att_2_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Arguments:
Arguments can be found Rt Click View Properties second tab in the properties as shown. The following table shows the list of arguments in the Wave One Index Player RAM module, explanations along with their respective default values.
![](../../__attachments/3037692263/att_8_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Arguments | Description | Default Value |
blockSize | Number of samples per output channel. | By default, blockSize = Blank |
sampleRate | Sample rate of the output signal, in Hz. | By default, samplerate = Blank. |
maxIndex | Usually, the length of the wav file/files in samples | By default, maxIndex = 2048. |
numWavPlayer | Size of array to hold the normalized playback rate of each wave file | By default, numWavPlayer = 2. |
maxPlaybackRate | Maximum playback rate | By default, maxPlaybackRate =5. |
useRPM | Are the module input values RPM units | By default, useRPM = False |
Wave Index Player RAM
The RAM based Wave Loop Player reads the audio data embedded from samples stored within the module.
![](../../__attachments/3037692263/att_3_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 2: Wave Index Player RAM
Input/Output Pins:
The Wave Index Player RAM has one input and one output pin.
Index input pin is a control value and is used to trigger the audio playback file. It is a Boolean value pin and requires a Low to High input for the playback to start and continues until the end of the WAV file and then stops. Retriggering while being in the middle of the playback has no effect and is ignored.
Audio output pin is the first output pin in this module and produces the processed audio samples from the wave files.
Variables:
The variables are the first tab in Module properties which is Rt Click on the module View Properties.
![](../../__attachments/3037692263/att_12_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 3: View Properties
![](../../__attachments/3037692263/att_4_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Arguments:
Arguments can be found Rt Click View Properties second tab in the properties as shown. The following table shows the list of arguments in the Wave One Index Player RAM module, explanations along with their respective default values.
![](../../__attachments/3037692263/att_9_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 4: Argument Tab for Wave Index Player RAM
Arguments | Description | Default Value |
numChannels | Number of interleaved channels in the audio output pin. | By default, numChannels = 1. |
blockSize | Number of samples per output channel. | By default, blockSize = 256. |
sampleRate | Sample rate of the output signal, in Hz. | By default, SAMPLERATE = 48000. |
fileName | Name of the wave file to be played. | By default, WAVFILE = ''. |
InterpolationMode | interpolation method. Linear Cubic | By default, INTERP = linear. (Only in floating point variant) |
normalizedPlaybackRate | normalized playback rate. | By default, NRATE = 1. |
isplayingpin | Boolean that provides the current playback state (PLAYING=1, STOPPED=0) | |
enablePin | Does the module have an enable input pin | By default, False |
Workings
In the example shown below, we are using two Wave Index Players that receive the index of the starting sample from a Wave Index Vector module. The Wave Index Players have an input of two different car revving wav file at 48kHz sample rate. By increasing the RPM value [DC Source module] which is fed as a ratio to the wave vector module, the rate of the wav file is controlled. You can see the output from Sink Display that both the wav files are synchronized with increase and decrease in the input RPM value. To run this example, use WaveIndexPlayer_RAM.awd provided along with car-motor-revving.wav and car_revving.wav as the two input files to the Wave Index Player modules. You can add more Wave Players along with indicating the number at ‘numWavPlayer’ variable in the Wave Index Vector module.
![](../../__attachments/3037692263/att_13_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 5: Wave Index Player RAM Example
Wave Index Player FFS
![](../../__attachments/3037692263/att_5_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 6: Wave Index Player FFS
Wave Index Player FFS works on both AWE Core and AWE CoreOS provided that the target has enough memory to accommodate FFS container (.bin).
Input/Output Pins:
The Wave One Index Player FFS has three input and one output pins. The added input pin is explained below whereas the rest remain the same as for RAM.
fsInstance is the first input pin and is an integer data type. This input pin provides the instance address of the flash file system wrapper and must be valid to be ready to use.
Index input pin is a control value and is used to trigger the audio playback file. It is a Boolean value pin and requires a Low to High input for the playback to start and continues until the end of the WAV file and then stops. Retriggering while being in the middle of the playback has no effect and is ignored.
Audio output pin is the first output pin in this module and produces the processed audio samples from the wave files.
Variables:
The variables are the first tab in Module properties which is Rt Click on the module View Properties. In this case the variables are the same as in the case of RAM module.
Arguments:
Arguments can be found Rt Click View Properties second tab in the properties.
![](../../__attachments/3037692263/att_10_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 7:Arguments of Wave Index Player FFS
Arguments | Description | Default Value |
numChannels | Number of interleaved channels in the audio output pin. | By default, numChannels = 1. |
blockSize | Number of samples per output channel. | By default, blockSize = 256. |
sampleRate | Sample rate of the output signal, in Hz. | By default, SAMPLERATE = 48000. |
fileName | Name of the wave file to be played. | By default, WAVFILE = ''. |
InterpolationMode | interpolation method. Linear Cubic | By default, INTERP = linear. (Only in floating point variant) |
normalizedPlaybackRate | normalized playback rate. 1 corresponds to 1x playback rate. | By default, NRATE = 1. |
isplayingpin | Boolean that provides the current playback state (PLAYING=1, STOPPED=0) | By default: False |
muteMod | Used to mute output before changing file in run time. | By default: Blank |
unMuteMod | Used to unmute after reconfiguration. | By default: Blank |
enablePin | Does the module have an is enable input pin. | By default: False |
Workings
We are using the same example as for the RAM variant for the Wave Index Player FFS. In this case the two-wav file is being fed through the File Buffer Module as a .bin file. For an in depth understanding of making a .bin files please refer to the ‘Wave Library Generator Tool’ application note. The output of the File Memory Buffer is given to an FFS Wrapper for Native Mode. The FFS Wrapper module outputs an instance pointer which is then given to the Wave Index Player FFS. This example can be found in WaveIndexPlayer_FFS.awd.
![](../../__attachments/3037692263/att_14_for_3037692263.png?inst-v=afeb83b1-861e-46b8-b4de-1c642321bb7f)
Figure 8: Wave Index Player FFS Example
WaveIndexPlayer_RAM.awd WaveIndexPlayer_FFS.awd car-motor-revving.wav car_revving.wav WaveLibraryGenerator.exe