Engee documentation

From Multimedia File

Stream from a multimedia file.

from multimedia file

Description

The From Multimedia File block reads .wav audio file data samples from a multimedia file and generates a signal with one of the following data types and amplitude ranges.

Output data type Output amplitude range

Float64

±

Float32

±

Int16

from to (from to

Uint8

from to

Output

Audio - audio signal
scalar | matrix

If the vector is not scalar, it is necessarily a matrix M by N, where N is the number of channels.

  • Data types:* Float64| Float32 | Int16 | UInt8

Parameters

Main

File name - multimedia file name
/user/input.wav (by default) | string

Specify the name of the multimedia file for the reading block.

Inherit sample time from file - inherit sample time from file
enabled (by default)| disabled

Enable this parameter to have the block inherit the sample time from the input media file.

Uncheck this parameter to have the unit use the sample time you specified in the Desired sample time parameter.

Select this option when you do not know the expected sample rate of the media file.
Desired sample time - block sampling time
1/30 (by default) | real positive scalar

Specify the block sampling time.

Dependencies

To enable this option, clear the Inherit sample time from file check box.

Number of times to play file - the number of times to play the media file
Inf (by default) | ` a positive integer'.

Specify the number of times to play the input media file.

By default, Inf means that the unit repeats the media file playback until the simulation stops.

Read range - range of audio samples
[1, Inf] (by default) | double element vector.

Specify the range of samples to be read from as a two-element vector of strings in the form [StartSample EndSample], where StartSample is the sample from which the file reading starts, and EndSample is the sample at which the file reading stops.

Samples per audio channel - samples per audio channel
1024 (by default) | `positive integer `

Specify the number of samples per audio channel.

Data Types

Audio output data type - audio output data type
Float64 (by default) | Float32 | Int16 | UInt8

Specify the data type for audio samples output through the Audio port.

Additionally

* Sampling rates *

The sampling rate this unit uses depends on the sampling rate of the audio streams.

While the From Multimedia File block operates at the same frequency, the underlying audio streams may have different frequencies.

Sampling time calculations used for audio files

Sampling time:

.

The sample time the block has on the output port is defined as follows: audioFrameSize / FPS, where audioFrameSize is the value of the Samples per audio channel field and FPS is the frequency of the data encoded in the wav file.