-
Notifications
You must be signed in to change notification settings - Fork 185
AudioDevice Class Reference
The AV.AudioDevice
class is responsible for interfacing with various audio APIs in browsers, keeping track of the current playback time based on the device hardware time, and the play/pause/seek state. It emits the refill
event with a buffer to fill with audio data when it needs new audio data.
Creates a new AV.AudioDevice
with the specified sample rate and number of channels.
Whether or not the device is currently playing. Changing this property will not have any effect. Think of it as read-only. :)
The current playback time in milliseconds.
Creates the correct audio device for the current browser if it hasn't already been created, and starts emitting refill and timeUpdate events and updating the currentTime
.
Stops emitting all events and updating currentTime
.
Seeks the currentTime
to the given time.
Emitted whenever the device needs new audio data to play back. Emitted with a Typed Array to fill with Linear PCM audio data.
Emitted every 200 milliseconds while the device is playing with an update to the current playback time, based on the actual device time.
The Device
interface describes the methods and properties you must implement if you want to provide support for additional audio APIs.
Creates a new instance of the device with the specified sample rate and number of channels. The device must start emitting refill events as soon as it is created.
Whether or not the device is supported on the current browser or platform.
Destroys the device and stops emitting refill events.
Returns the current device time.
Once you've implemented the Device
interface, you must register it with the AudioDevice
class using this method.
Finds the first supported audio device and returns an instance with the specified sample rate and number of channels.