Constructor
new AudioFilePlayer(audioContext, audioFile)
Create an audio file player.
Parameters:
| Name | Type | Description |
|---|---|---|
audioContext |
Object | An AudioContext. |
audioFile |
Object | The audio file to play. |
Methods
endPlayer()
This is called when buffer playback has eneded.
(async) isReady() → {Promise}
Is this player ready to play?
Returns:
A promise that resolves when this player has decoded its audio file.
- Type
- Promise
pause()
Pause.
play()
Play.
setTimeRange(start, stop)
Sets the specified time range for the BufferPlayer.
Parameters:
| Name | Type | Description |
|---|---|---|
start |
number | The start time. |
stop |
number | The end time. |
skip(time)
Skip to the specified time.
Parameters:
| Name | Type | Description |
|---|---|---|
time |
number | The time to skip to. |
stop()
Stop.