Contents

init(contentsOf:)

Creates a player to play audio from a file.

Declaration

init(contentsOf url: URL) throws

Parameters

  • url:

    A URL that identifies the local audio file to play.

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.

See Also

Creating an audio player