Initializer

init(fileNamed:)

Initializes an audio source from an audio file in the application’s main bundle.

Declaration

convenience init?(fileNamed name: String)

Parameters

name

The name of an audio file in the application’s main bundle.

Return Value

A new audio source object.

Discussion

Calling this method is equivalent to using the Bundle class to locate an audio file in the application’s main bundle and then passing the resulting URL to the init(url:) method.

See Also

Creating an Audio Source

init?(named: String)

Returns the audio source associated with the specified filename.

init?(url: URL)

Initializes an audio source from the specified audio file.