Skip to main content
Skip table of contents

File Memory Buffer

About This Guide

This application note describes the usage and workings of File Memory Buffer Module.

File Memory Buffer Module

The File Mem Buffer module implements the Audio Weaver wrapper for MP3 decoder on native PC target. The module can be found in Sound Design -> Control -> FileMemBuffer in the Module Bar on the left-hand side of AudioWeaver Designer.

Figure 1: File Mem Buffer

Figure 2: File Mem Buffer Module location

Output Pin and Arguments

bufferPtr is the output pin for this module. The bufferPtr points to the starting address of the file buffer. If the address is 32Bit then only ch1 contains the value and ch2 remains 0. For a native PC mode this output is given to the FFSStartAddr input in the FFS Wrapper module.

Figure 3: bufferPtr Output Pin

Argument for the File Mem Buffer is fileName in which the .Bin file path is required to be provided.

Figure 4:File Mem Buffer: Arguments

Workings

To explain the workings of the File Mem Buffer module we are using ‘FileMemoryBuffer_Example.awd’. In this example awd we are using the File Memory Buffer module to store the wave files converted into a .Bin file by using a script. The .Bin file here is awe_ffs_sim.bin and the file path is put into the module argument ‘fileName’. The output of the module is the buffer pointer value, which is given as an FFS starting address for the FFS Wrapper module. We are using a FFS Wrapper module as this example is for the Native PC mode. The FFS instance pointer value is given to the Wave One Shot Players ‘fsInstance’ pin. We have specified the names of the wave file to be played at each Wave One Shot Player modules that are in use namely sin_1k.wav and sin_2k.wav at the arguments tab of each module.

After starting the design by pressing ‘RUN’, the Trigger value needs to be shifted from 0-> 1 for a valid trigger to the Wave One Shot Player modules. With the positivity edge trigger, the output of the Wave One Shot Payer is given to the sink display as can be seen in the figure below. The frequency of the wave file can be controlled by the Pitch -> fRation which can be changed between 1-10 depending on the maxPlaybackRate set in the arguments.

Figure 5: File Mem Buffer Example 1

Figure 6: File Mem Buffer Example: 2

sine.mp3 FileMemoryBuffer_Example.awd

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.