prepareAudio(configuration:_:)
Prepares a real-time audio playback instances.
Declaration
@MainActor @preconcurrency func prepareAudio(configuration: AudioGeneratorConfiguration = .init(), _ generatorRenderHandler: @escaping Audio.GeneratorRenderHandler) throws -> AudioGeneratorControllerParameters
- configuration:
A set of configuration parameters necessary for initializing and rendering the
generatorRenderHandler. - generatorRenderHandler:
The audio render handler to prepare. The system runs this handler to generate real-time audio.
Return Value
An AudioGeneratorController instance that you use to manage audio playback. Use the controller to set the volume and start or stop playback.
Discussion
If you want to start playback immediately, use the playAudio(configuration:_:) method instead.