Contents

init(data:fileTypeHint:)

Creates a player to play in-memory audio data of a particular type.

Declaration

init(data: Data, fileTypeHint utiString: String?) throws

Parameters

  • data:

    A buffer with the audio data to play.

  • utiString:

    The uniform type identifier (UTI) string of the file format.

Return Value

A new audio player instance, or nil if an error occurs.

Discussion

The audio data must be in a format that Core Audio supports. Passing a file type hint helps the system parse the data if it can’t determine the file type or if the data is corrupt. See AVFileType for supported values.

See Also

Creating an audio player