This version (22 Jun 2018 07:11) was approved by Venkatesan Krishnamoorthy.The Previously approved version (22 Jun 2018 06:57) is available.Diff

Wav Player

Click here to return to the Master Control Port section.

This module can be used to read PCM/WAV files from external Flash connected to ADAU145x via SPI. This module also can perform pitch shifting while playing the file.

The following list shows the various audio files supported by this module.

  1. Audio Samples in 8.24 Fixed point format (Mono/Stereo)
  2. Wav file with out header (PCM) (Mono/Stereo)
    1. 8 Bits per Sample (Signed Integer)
    2. 16 Bits per Sample (Signed Integer)
    3. 24 Bits per Sample (Signed Integer)
    4. 32 Bits per Sample (Signed Integer)
  3. Wav file with Wav header(Mono/Stereo)
    1. 16 Bits per Sample (Signed Integer)
    2. 24 Bits per Sample (Signed Integer)
    3. 32 Bits per Sample (Signed Integer)

Note: 8 Bits per sample is not supported for Wav file.
Note: Pitch shifting is not supported for stereo files.

Flash Programmer can be used to write wav files to the SPI flash from ADAU145x.

Input Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Triggerint- controlRising edge in the input triggers the Wav File read from SPI flash.
Pin 1: Wav Selectint- controlSelects the wav file from the SPI flash. 0 → first file, 1→ second file, etc.
Pin 2: Pitch factordec- control Speed of the Wav player. This pin will be available only if the pitch shifting is enabled.

Output Pins

NameFormat [int/dec] - [control/audio]Function Description
Pin 0: Left Outdecimal - audioLeft Audio Sample
Pin 0: Right Outdecimal - audioRight Audio Sample. This pin will be available only if the number of audio channels is set as 2.

Grow Algorithm

The module currently does not support grow/add functionality.


Click on the image to configure the SPI interface for the module.

GUI Control NameDefault ValueRangeFunction Description
Bit Rate100kHZ 100 kHZ - 100000 kHZ SPI Speed
SPI Slave Select0 0-6 Slave Select for the SPI. Register window should be configured to match this selection.Please refer the note below.
Sub-Address Bytes2 1-4 Number of address bytes excluding the read/write command
SPI ModeMode 3 Mode0/Mode3SPI operation mode
R/W (Chip Address) Bytes10-255Command Bytes (Number of bytes required for command)
Read Instruction (SPI)00-255Instruction value for a read operation (0x1 for ADI audio devices, typically 0x3 for eeprom/flash)
Audio File FormatAudio Sample in 8.24Wav without header (PCM)/ Wav with header/Audio Sample in 8.24 formatSelection of audio file format
Number of Channels21/2Number of channels in the audio file stored in SPI flash.
Bits Per Sample168/16/24/32Bits per sample in the audio file stored in SPI flash.
Number of Audio Files11-16Number of audio files written in the SPI flash.
LoopbackDisabledEnabled/DisabledEnable/Disable loopback.
Pitch ShiftingDisabledEnabled/DisabledEnable/Disable pitch shifting.
Start Address1*00 - 16777216 (16 MBytes)Start Address of Audio file 1 in the SPI flash. (in Bytes)
Length1*1920001 - 16777216 (16 MBytes)Length of Audio file 1 in the SPI flash. (in Bytes)

Note: Length and Start Address controls will be repeated for 'Number of Audio Files' times. Any change in these configuration parameters requires a recompilation.

Note: Please make sure that the Length is accurate in bytes. If Flash Programmer module is used to write the file to the SPI EEPROM, check the wav file size from the properties in windows and enter it into length field.

Support for Different Slave Select

If the Slave Select is 0 and MP0 is used as chip select, no configuration is required in the register controls. Otherwise particular multipurpose pin should be configured to act as the slave select in the register window. (Hardware Configuration → ICx - ADAU145x Register Controls → MULTIPURPOSE/ AUXADC)

  1. Slave Select Channel → 'Slave Select Channel x'
  2. MPx pin mode → 'Slave Select for Master SPI port'
  3. MPx pin function → 'Multipurpose function'

The following table shows the mapping between module's parameter and the register control window.

'Slave Select' in Configuration Window 'Slave Select Channel' in the Register control
1 Slave Select Channel 0
2 Slave Select Channel 1
3 Slave Select Channel 2
4 Slave Select Channel 3
5 Slave Select Channel 4
6 Slave Select Channel 5

Support for Multiple Files

Number of wav files can be configured in the 'Control Port Properties' window. Start Address and Length for each of the wav file should be configured in the 'Control Port Properties' window.

Dynamically the wav file can be selected from the external pin.

Pitch Shifting

Pitch shifting option can be enabled to control the speed of the Wav file playback.

In the above example the pitch shifting factor/speed is set as 1.5 (Note that this should be in 8.24 fixed point format). So the file plays at the speed of 1.5. Assume the EEPROM/Flash contains the sine tone of 500 Hz. The playback will be sine tone of 750Hz (1.5 * 500).

DSP Parameter Information

GUI Control NameCompiler NameFunction Description
StartAddress1WavPlayerAlg1sample1_startArray of start addresses of Audio files in SPI flash
Length1WavPlayerAlg1sample1_endArray of end addresses of Audio files in SPI flash (Calculated as StartAddress + Length)


  • Green - Algorithm Name
  • Red - Instance Number (Changes for each instance)
  • Blue - Parameter Name
  • Brown - File Number (Changes for each files)

Supported ICs

  1. ADAU145x
resources/tools-software/sigmastudio/toolbox/mastercontrolport/wavplayer.txt · Last modified: 22 Jun 2018 07:11 by Venkatesan Krishnamoorthy