Initializes an audio source from an audio file in the application’s main bundle.
SDKs
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Scene
Kit
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.