Module

Audio.WebAudio.AudioBufferSourceNode

Package
purescript-webaudio
Repository
adkelley/purescript-webaudio

#StartOptions Source

type StartOptions = { duration :: Maybe Seconds, offset :: Maybe Seconds, when :: Maybe Seconds }

A record of options to the function startBufferSource See Webaudio API AudioBufferSourcenode.start for more information https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start

#defaultStartOptions Source

defaultStartOptions :: StartOptions

A convenience function specifying the default parameters for the function startBuffersource

#setBuffer Source

setBuffer :: AudioBuffer -> AudioBufferSourceNode -> Effect Unit

Prime the node with its AudioBuffer.

#startBufferSource Source

startBufferSource :: StartOptions -> AudioBufferSourceNode -> Effect Unit

Start playing the AudioBuffer. Match on the record StartOptions to determine what options have been specified by the calling function.

#stopBufferSource Source

stopBufferSource :: Seconds -> AudioBufferSourceNode -> Effect Unit

Stop playing the AudioBuffer.

#loop Source

loop :: AudioBufferSourceNode -> Effect Boolean

Indicate that the AudioBuffer should be replayed from the start once its end has been reached.

#loopStart Source

loopStart :: AudioBufferSourceNode -> Effect Seconds

The time, in seconds, at which playback of the AudioBuffer must begin when loop is true (default 0).

#loopEnd Source

loopEnd :: AudioBufferSourceNode -> Effect Seconds

The time, in seconds, at which playback of the AudioBuffer must end when loop is true (default 0).