Audio script interface
The IAudioObjectType
interface derives from IObjectClass to add APIs specific to the Audio plugin.
The script interface essentially just provides access to the underlying AudioContext (part of the Web Audio API) that the Audio plugin uses internally for audio playback. However this is sufficient to provide complete control over audio playback, including setting up complex graphs of audio processing nodes. It is also convenient, since Construct manages some awkward details such as ensuring playback is enabled as soon as possible given most browsers impose autoplay restrictions. Adding the Audio object and using its script interface saves you from having to re-implement these details yourself.
Note this class derives from the object class interface, not the instance interface. Typically it is used through runtime.objects.Audio
.
Examples
The following examples demonstrate using the Web Audio API for audio playback.
Audio APIs
- audioContext
- The Audio plugin's internal AudioContext used for audio playback.
- destinationNode
- The destination node to connect any additional audio nodes to.
Construct Animate Manual
Construct.net
2020-01-13
2022-12-01
You are here:
Search this manual:
This manual entry was last updated on 1 Dec, 2022 at 16:38