Engee documentation

From Multimedia File

A stream from a multimedia file.

blockType: From Multimedia File

Path in the library:

/Signal Operations/Sources/From Multimedia File

Description

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

Type of output data Output amplitude range

Float64

±

Float32

±

Int16

from before (from before

Uint8

from before

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 — name of the multimedia file

Details

Specify the name of the multimedia file to read.

It is acceptable to specify the absolute path to the file (starting with /user), and relative. In this case, the relative path is determined from the current directory (pwd).

You can also specify only the file name. In this case, Engee will search for a file with that name first using 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 the sampling period from a file
Logical

Details

Enable this option so that the block inherits the sampling period from the input multimedia file.

Uncheck this option so that the block uses the sampling period specified in the parameter Desired sample time.

Select this option when you do not know the estimated sampling rate of the multimedia 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 use this option, uncheck the option. Inherit sample time from file.

Default value

1/30

Program usage name

userDefinedSampleTime

Tunable

No

Evaluatable

Yes

# Number of times to play file — the number of media file plays
Real number

Details

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

Default value Inf This means that the block repeats the playback of the multimedia file 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 row vector in the form [StartSample EndSample], where StartSample – this is the countdown from which the reading of the file begins, and EndSample – the countdown at which the file reading stops.

Default value

[1, Inf]

Program usage name

readRange

Tunable

No

Evaluatable

Yes

# Samples per audio channel — audio channel counts
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 the audio samples output via the Audio port.

Values

Float64 | Float32 | Int16 | UInt8

Default value

Float64

Program usage name

audioDataType

Tunable

No

Evaluatable

No

Additional Info

Sampling rates

Details

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

While the block From Multimedia File It works with the same frequency, the base audio streams may have different frequencies.

Sampling period calculations used for audio files

Details

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

,

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