The FilePlayer audio object is used to read the audio content from a file and present them in real time on the output channels. Additionally, this audio object can also be used to add or mix the file content with the audio fed into the input channel buffers of this object.
A background thread is used to read the file contents in bulk and place them in the intermediate cache buffer, while in the main thread for each audio interrupt, the required audio data (of framework block length size) is copied from the intermediate cache buffer to the output channel buffers. The background thread periodically checks for the number of samples available in the cache buffer and replenishes the needed files.
Use Case: The FilePlayer has following use case.
- Stream wav files from local filesystem in realtime
- Resample to target sample rate if needed
- Option to support play speed from 0.1 to 10
- Shall support option to disable / enable pitch shifting (linear and polyphase)
- Shall support mixing the file content with the output of another AO
- Support configurable number of output channels (up to 16)
- Support WAV / PCM Files configurable during design time. Furthermore, WAV / PCM files with all of these data types are supported.
- 8 bit mu-law
- 8 bit A-law
- 16 bit integer
- 24 bit integer
- 32 bit float
Internally, all samples are converted to 32 bit floating point numbers. For both the 8 bit command formats, the conversion is done via a lookup table with 256 entries. This look-up table is filled based on the encoding format.
File Player Properties

| Properties | Descriptions |
| # of channels | The number of channels are configurable.
|
| Display Name | Display the name of the FilePlayer audio object in signal flow design. It can be changed based on the intended usage of the object. |
| Object mode | The object has two modes.
|
| Additional Parameters |
|
Mode
FilePlayer audio object supports two different modes of operation. The audio object can read from both WAV and PCM files.
- WAV (Default): The WAV file contains a header that has the necessary details about the stored audio content in the file
- PCM: the PCM file contains only the audio data and the details such as sampling rate and data format of the stored audio data must be provided separately.
Additional Parameters
The FilePlayer audio object can be configured with the following additional parameters:
| Parameter | Descriptions | |
| Pitch shifting | This feature is provided to increase or decrease the playing speed (sample rate at which the content is played).
|
![]() |
| Add file data with inputs |
If this feature is enabled, an equal number of input channels will be supported. Add the content of the audio file with the output of previous AO to generate the output. By default, the AO will have only output channels and no input channels.
|
![]() |
| CacheBuffer size | Allocate internal memory for reading data in the background thread.
If the background thread is having significantly lower priority, the buffer underrun is likely to occur for lower cache sizes. In such cases, the cache buffer size shall be increased. |
![]() |
| File Type | The object supports the below files:
|
![]() |
| Data format (only for PCM mode) |
|
![]() |
| Content Sample Rate (only for PCM mode) |
All sample rates supported by framework shall be supported Default sample rate is 48000 Hz. |
![]() |
Tuning Parameters
Below table describes the tuning parameters of FilePlayer audio object.
| Parameters | Description | Unit | Range | Default |
| Ramping Params Sub block: This subblock has ramping related tuning parameters applicable to all the channels. All the parameters in this sub-block as stored as unsigned integers. | ||||
| Fade-in time | Applied for control change from Stop / Pause to Play | ms | 0 to 1000 | 100 |
| Fade-in type | Linear type only is implemented
|
None |
0 or 1 (Enum)
|
0 |
| Fade-out time | Applied for control change from Play to Stop / Pause | ms | 0 to 1000 | 100 |
| Fade-out type | Linear type only is implemented
|
None |
0 or 1 (Enum)
|
0 |
| Fade-out delay | Delay period before starting fade-out process | ms | 0 or 100 | 0 |
| Quick Fade-out time | Applied when play command is received during fade-out or fade-out delay phase to quickly end the fade-out phase and start playback. Also quick fade-out is applied only when this value is less than fade-out time. By default, this feature is disabled as the default value is not less than the fade-out time. Only linear ramping is applied.
This parameter is available from W Release |
ms | 0 to 1000 | 1000 |
| Pitch ramp time | This parameter is available only when pitch shifting is enabled and is applied for any change in play speed value | ms | 0 to 100 | 0 |
| Pitch ramp type |
This parameter is available only when pitch shifting is enabled. Linear type only is implemented. 0 – Linear 1 – Exponential (not implemented) |
None |
0 or 1 (Enum)
|
0 |
| File_Config sub block: There is a separate file configuration sub block for each file. In SingleMultiChannel mode, only one sub block is present whose parameters are applicable for all the channels. In MultipleMonoFiles mode, each file has its own sub block where the parameters in each sub block is applicable for the respective mono channel.
This sub block is available from W Release |
||||
| File ID | The files shall be placed in the device folder using FileController. | None |
1 to 255 Data Type: Unsigned Integer |
1 |
| Play Setup |
|
None |
1 to 3 (Enum) Data Type: Unsigned Integer |
1 |
| Start Position | Start position in percentage from where file will be played. In LOOP mode, this is applicable only at the start of the play and not on every loop back | None |
0 to 99.99 Data Type: Float |
0 |
| Function |
1 – STOP 2 – PLAY 3 – RESET (STOP and PLAY) 4 – PAUSE |
None |
1 to 4 (Enum) Data Type: Unsigned Integer |
1 |
| Interval# | This is applicable only in Intermittent mode. This is the interval period at which the file will be played from the beginning periodically. | s |
0.01 to 1000 Data Type: Float |
10 |
| Play Speed* | This is available only when pitch shifting is enabled. This is the play speed at which the file is played | None |
0.1 to 10 Data Type: Float |
1 |
# The interval period normally shall be greater than the waveform playback duration. If the interval is less than or equal to the waveform playback duration, glitch / pop noise with a short mute period is seen.
* Playback Duration = File Duration / Play Speed
State Parameters
| Parameters | Description | Unit | Range | Default |
| Function State Sub block: This subblock has the function state parameter for each file. This parameter is used to configure and readback the present function state of the given channel(s). In SingleMultiChannel mode, only one state parameter is present that is applicable for all the channels. In MultipleMonoFiles mode, each file has its own state parameter applicable for the respective mono channel. | ||||
| Function_Ch |
1 – STOP 2 – PLAY 3 – RESET (STOP and PLAY) 4 – PAUSE |
None |
1 to 4 (Enum) Data Type: Unsigned Integer |
1 |
| File State Sub block: This subblock has the file state parameter for each file. This parameter is used only to readback the present file state of the given file(s) and any parameter change is ignored. In SingleMultiChannel mode, only one state parameter is present for the given file. In MultipleMonoFiles mode, each file has its own state parameter.
This sub block is available from W Release |
||||
| File_State |
This reflects the present file status. 0 – FILEPLAYER_IDLE 1 – FILE_READY 2 – FILE_PLAY_ACTIVE 3 – FILE_STOPPED 4 – FILE_OPEN_ERROR 5 – FILE_PAUSED |
None |
0 to 5 (Enum) Data Type: Unsigned Integer
|
0 |
Control Parameters
The FilePlayer audio object can be configured with multiple channels. The channel count of the object and the number of channels in the wav file may differ. Error message is returned if extra channels are present in the audio file. If extra channels are configured in the object, those extra channels are filled with silence.
Control Inputs
The FilePlayer has the following Control Inputs.
| Control Input | Description | Size in Float Words | Range |
| Block Control: There are FOUR control pins under this block control pin. For SingleMultiChannel mode, only one set of block control input needs to be sent. For Multiple Mono mode, for each channel a set of block controls needs to be sent separately. | |||
| Channel ID | Channel ID to associate with each output channel. | 1 of 4 | 1 to 16 |
| File ID |
Till V Release: The file name needs to be a numeral in this range with .wav or .pcm extension. The files shall be placed in the dll folder. From W Release: The files shall be sent through the FileController. |
2 of 4 | 1 to 255 |
| File Setup |
|
3 of 4 | 1 to 3 |
| Start Position | Start position in percentage from where file will be played. | 4 of 4 | 0 to 99.99 |
| Function Control Pins: This control pin is used to change the function of the AO. For AOs configured in Single Multichannel mode, only one (N = 1) control input pin will be available applicable to all the channels. For AOs configured in Multiple Mono mode with N channels, there will be equal number (N) of control inputs for each file (channel). |
|||
| Function |
|
N | 1 to 4 |
| Interval Control Pins: This control pin is applicable only in INTERMITTENT play mode and is used to change the interval period of the playback. For AOs configured in Single Multichannel mode, only one (N = 1) control input pin will be available applicable to all the channels. For AOs configured in Multiple Mono mode with N channels, there will be equal number (N) of control inputs for each file (channel). These Interval control pins are available from W Release |
|||
| Interval | This is the interval period at which the file will be played from the beginning periodically. | N | 0.01 to 1000 s |
| Pitch Control Pins: This control pin(s) is/are available only when pitch shifting is enabled and is used to change the play speed of waveform playback. For AOs configured in Single Multichannel mode, only one (N = 1) control input pin will be available that is applicable to all the channels. For AOs configured in Multiple Mono mode with N channels, there will be equal number (N) of control inputs for each file (channel). |
|||
| Play Speed | This is the play speed at which the file is played
Till V Release: The control input is in terms of deviation in semi-tones. From W Release: The control input is in terms of play speed. |
N |
Till V Release: -40 to 40 From W Release: 0.1 to 10 |
Control Outputs
The FilePlayer has the following Control Output.
| Control Output | Description | Size in Float Words | Range |
|
There are two control output pins – either two single control pins or two block control pins. When the AO is configured in Single Multichannel mode, two single control (N = 1) pins are available for the control outputs listed below. When the AO is configured in Multiple Mono mode with N channels, two block control (N) pins are available for the control outputs listed below. |
|||
| Play Position | During active playback, for every audio interrupt, the AO outputs the play position in terms of percentage covered in the file. | N | 0 to 99.99 |
|
File State
|
These Control output pins are available from W Release Whenever there is a change in the file status, the AO outputs the file state: 0 – FILEPLAYER_IDLE 1 – FILE_READY 2 – FILE_PLAY_ACTIVE 3 – FILE_STOPPED 4 – FILE_OPEN_ERROR 5 – FILE_PAUSED |
N | 0 to 5 |
In Single Multichannel file mode, mono file also can be played.
Multiple Mono file mode, all the files need to be mono files. In WAV mode, if the file is seen having more than 1 channel, that file will be ignored. In PCM mode, the file will be taken as a mono file and played leading to improper output.
In Multiple Mono file mode, all the mono files need to be in the same data format and sampling rate. If files with different data format are used, the data format of the last configured file will be considered and the same will be applied to all other mono files leading to improper output.
In cases with low intermediate cache buffer size, the background thread need to run frequently to replenish the data available in the cache buffer. If distortion is observed with low cache size, buffer underrun could be the cause and background thread shall be moved to higher priority or the cache buffer size shall be increased.
It is recommended to configure the sound card block length to 1024 under Sound Card Configuration while using IVP.
The memory required for the supporting the intermediate cache buffer size will be slightly more than double the size specified in the additional parameters as it is required to support ping-pong concept and extra data for supporting filtering. The memory latency table shall be referred for exact memory requirements.
In Single Multichannel file, let the number of files present in the file content be M and the number of channels configured for the object be N.
In WAV mode:
– If M = N, all the N channels will be played with the file content.
– If M < N, first M channels buffers will be populated with the file content and the remaining N-M channels will be muted.
– If M > N, none of the channels will be played and all channels will be muted.
In PCM mode:
– If M = N, all the N channels will be played properly with the file content.
– If M != N, the file will be taken as a N channel file and played leading to improper output.
Native Panel
FilePlayer audio object does not support native panel.





