Engee documentation

From Multimedia File

Stream from a multimedia file.

blockType: From Multimedia File

Path in the library:

/Signal Operations/Sources/From Multimedia File

Description

The From Multimedia File unit 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

Ports

Output

# Audio — audio signal
scalar | matrix

Details

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

Data types

Float64, Float32, Int16, UInt8.

Complex numbers support

No

Parameters

Main

# File name — media file name

Details

Specify the name of the media file to read.

It is allowed to specify both absolute path to the file (starts with /user) and relative path. The relative path is defined from the current directory (pwd).

It is also possible to specify only the file name. In this case Engee will search for a file with this name first in the relative path (i.e. in the current directory) and then in the search paths: Engee path editor.

Default value

/user/input.wav

Program usage name

inputFilename

Tunable

No

Evaluatable

Yes

# Inherit sample time from file — inheriting a sampling period from a file
Logical

Details

Enable this parameter to have the unit inherit the sampling period from the input media file.

Uncheck this parameter to have the block use the sampling period you specified in the {blockLibraryPPP_blockTypesPPP_FromSS_MultimediaSS_FilePP_BasePPP_paramsPP_PPP_PP_PP_userDefinedSampleTimePP_label parameter.

Select this parameter when you do not know the expected sample rate of the media file.
Default value

true (switched on)

Program usage name

inheritSampleTime

Tunable

No

Evaluatable

No

# Desired sample time — sampling period
SampleTime (real number / vector of two real numbers)

Details

Specify the sampling period of the block.

Dependencies

To enable this parameter, uncheck the checkbox of the parameter Inherit sample time from file.

Default value

1/30

Program usage name

userDefinedSampleTime

Tunable

No

Evaluatable

Yes

# Number of times to play file — number of times the media file has been played
Real number

Details

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.

Default value

Inf

Program usage name

numPlays

Tunable

No

Evaluatable

Yes

# Read range — audio sampling range
Array of real numbers

Details

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 file reading starts, and EndSample is the sample at which file reading stops.

Default value

[1, Inf]

Program usage name

readRange

Tunable

No

Evaluatable

Yes

# Samples per audio channel — countdowns to the audio channel
Integer

Details

Specify the number of counts per audio channel.

Default value

1024

Program usage name

audioFrameSize

Tunable

No

Evaluatable

Yes

Main

# Audio output data type — audio output data type
Float64 | Float32 | Int16 | UInt8

Details

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

Values

Float64 | Float32 | Int16 | UInt8

Default value

Float64

Program usage name

audioDataType

Tunable

No

Evaluatable

No

Additional Info

* 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 base audio streams may have different frequencies.

Sampling period calculations used for audio files

The sampling period that the unit receives at the output port is determined as follows:

,

where is the value of the parameter Samples per audio channel, and is the frequency of the data encoded in the wav file.