Ocarina.Interpret
- Package
- purescript-ocarina
- Repository
- mikesol/purescript-ocarina
#AudioWorkletNodeRequest Source
#getFFTSize Source
getFFTSize :: AnalyserNode -> Effect Int
#setFFTSize Source
setFFTSize :: AnalyserNode -> Int -> Effect Unit
#setSmoothingTimeConstant Source
setSmoothingTimeConstant :: AnalyserNode -> Number -> Effect Unit
#setMinDecibels Source
setMinDecibels :: AnalyserNode -> Number -> Effect Unit
#setMaxDecibels Source
setMaxDecibels :: AnalyserNode -> Number -> Effect Unit
#audioWorkletAddModule_ Source
audioWorkletAddModule_ :: AudioContext -> String -> Effect (Promise Unit)
For a given audio context, add the audio worklet module at a given URI.
#getAudioClockTime Source
getAudioClockTime :: AudioContext -> Effect Number
Gets the audio ctime from an audio context.
#stopMediaRecorder Source
stopMediaRecorder :: MediaRecorder -> Effect Unit
Stops a media recorder
#mediaRecorderToBlob Source
mediaRecorderToBlob :: String -> (Blob -> Effect Unit) -> MediaRecorder -> Effect Unit
For a given MIME type, pass the URL-ified content of a media recorder as a string to a handler.
mediaRecorderToUrl "audio/ogg" setAudioTagUrlToThisContent recorder
#mediaRecorderToUrl Source
mediaRecorderToUrl :: String -> (String -> Effect Unit) -> MediaRecorder -> Effect Unit
#isTypeSupported Source
isTypeSupported :: String -> Effect Boolean
Is this MIME type supported by this browser.
#decodeAudioDataFromUri Source
decodeAudioDataFromUri :: AudioContext -> String -> Aff BrowserAudioBuffer
Given an audio context and a URI, decode the content of the URI to an audio buffer.
#bracketCtx Source
bracketCtx :: forall a. (AudioContext -> Aff a) -> Aff a
#fetchArrayBuffer Source
fetchArrayBuffer :: String -> Effect (Promise ArrayBuffer)
#decodeAudioDataFromBase64EncodedString Source
decodeAudioDataFromBase64EncodedString :: AudioContext -> String -> Effect (Promise BrowserAudioBuffer)
Given an audio context and a base-64-encoded audio file, decode the content of the string to an audio buffer.
#makeAudioBuffer_ Source
makeAudioBuffer_ :: AudioContext -> { arr :: Array (Array Number), size :: Int } -> Effect BrowserAudioBuffer
For a given audio context, use an audio buffer to create a browser audio buffer. This is useful when doing DSP in the browser. Note that AudioBuffer
is a purescript type whereas WebAPI.BrowserAudioBuffer
is an optimized browser-based type. That means that, once you write to WebAPI.BrowserAudioBuffer
, it is effectively a blob and its contents cannot be retrieved using the Ocarina API.
#makeFloatArray Source
makeFloatArray :: Array Number -> BrowserFloatArray
Make a float 32 array. Useful when creating a waveshaper node.
#context_ Source
context_ :: Effect AudioContext
Make a new audio context.
#context Source
context :: forall m. MonadEffect m => m AudioContext
#constant0Hack_ Source
constant0Hack_ :: AudioContext -> Effect (Effect Unit)
Send 0s from a context immediately. This is useful on iOS so that the context doesn't switch to a suspended state.
#constant0Hack Source
constant0Hack :: forall e. MonadEffect e => AudioContext -> e (Effect Unit)
#contextState_ Source
contextState_ :: AudioContext -> Effect String
Get the state of the context
#contextState Source
contextState :: forall e. MonadEffect e => AudioContext -> e String
#contextResume_ Source
contextResume_ :: AudioContext -> Effect (Promise Unit)
Get the state of the context Get the state of the context
#contextResume Source
contextResume :: forall e. MonadEffect e => AudioContext -> e (Promise Unit)
#contextResumeAff Source
contextResumeAff :: forall e. MonadEffect e => AudioContext -> e (Aff Unit)
#close Source
close :: forall e. MonadEffect e => AudioContext -> e Unit
#BrowserMediaStream Source
data BrowserMediaStream
#audioWorkletAddModule Source
audioWorkletAddModule :: forall node payload numberOfInputs numberOfOutputs outputChannelCount parameterData processorOptions. IsSymbol node => Nat numberOfInputs => Pos numberOfOutputs => ValidateOutputChannelCount numberOfOutputs outputChannelCount => Homogeneous parameterData (AudioParameter payload) => WriteForeign (Record processorOptions) => AudioContext -> String -> (AudioWorkletNodeRequest node numberOfInputs numberOfOutputs outputChannelCount parameterData processorOptions) -> Aff (AudioWorkletNodeResponse node numberOfInputs numberOfOutputs outputChannelCount parameterData processorOptions)
#getMicrophoneAndCamera Source
getMicrophoneAndCamera :: Boolean -> Boolean -> Aff { camera :: Maybe BrowserCamera, microphone :: Maybe BrowserMicrophone }
#makeFFIAudioSnapshot Source
makeFFIAudioSnapshot :: AudioContext -> Effect FFIAudioSnapshot
Create a unit cache. This returns a fresh empty object {}
that is used to cache audio units.
#advanceWriteHead Source
advanceWriteHead :: FFIAudioSnapshot -> Number -> Effect Unit
#makePeriodicWave Source
makePeriodicWave :: forall len. Lt D1 len => AudioContext -> Vec len Number -> Vec len Number -> Effect BrowserPeriodicWave
Make a browser periodic wave. A PureScript-ified version of the periodic wave constructor from the Web Audio API. Given an audio context, a vector of real parts of complex numbers, and a vector of imaginary parts of complex numbers, build a periodic wave interpretable by the Web Audio API.
#AudioBuffer Source
data AudioBuffer
A multi-channel audio buffer.
Constructors
AudioBuffer Int (Array (Array Number))
Instances
#audioBuffer Source
audioBuffer :: forall bch blen. Pos bch => Pos blen => Int -> Vec bch (Vec blen Number) -> AudioBuffer
Make a multi-channel audio buffer. Each vector into the multi-channel buffer must be the same length.
#FFIAudioSnapshot Source
data FFIAudioSnapshot
#connectXToY_ Source
connectXToY_ :: ConnectXToY -> FFIAudioSnapshot -> Effect Unit
#makeAllpass_ Source
makeAllpass_ :: Mbe -> MakeAllpass -> FFIAudioSnapshot -> Effect Unit
#makeAnalyser_ Source
makeAnalyser_ :: Mbe -> MakeAnalyser -> FFIAudioSnapshot -> Effect Unit
#makeBandpass_ Source
makeBandpass_ :: Mbe -> MakeBandpass -> FFIAudioSnapshot -> Effect Unit
#makeConstant_ Source
makeConstant_ :: Mbe -> MakeConstant -> FFIAudioSnapshot -> Effect Unit
#makeConvolver_ Source
makeConvolver_ :: Mbe -> MakeConvolver -> FFIAudioSnapshot -> Effect Unit
#makeDelay_ Source
makeDelay_ :: Mbe -> MakeDelay -> FFIAudioSnapshot -> Effect Unit
#makeHighpass_ Source
makeHighpass_ :: Mbe -> MakeHighpass -> FFIAudioSnapshot -> Effect Unit
#makeHighshelf_ Source
makeHighshelf_ :: Mbe -> MakeHighshelf -> FFIAudioSnapshot -> Effect Unit
#makeIIRFilter_ Source
makeIIRFilter_ :: Mbe -> MakeIIRFilter -> FFIAudioSnapshot -> Effect Unit
#makeLoopBuf_ Source
makeLoopBuf_ :: Mbe -> MakeLoopBuf -> FFIAudioSnapshot -> Effect Unit
#makeLowpass_ Source
makeLowpass_ :: Mbe -> MakeLowpass -> FFIAudioSnapshot -> Effect Unit
#makeLowshelf_ Source
makeLowshelf_ :: Mbe -> MakeLowshelf -> FFIAudioSnapshot -> Effect Unit
#makeMediaElement_ Source
makeMediaElement_ :: Mbe -> MakeMediaElement -> FFIAudioSnapshot -> Effect Unit
#makeMicrophone_ Source
makeMicrophone_ :: Mbe -> MakeMicrophone -> FFIAudioSnapshot -> Effect Unit
#makeNotch_ Source
makeNotch_ :: Mbe -> MakeNotch -> FFIAudioSnapshot -> Effect Unit
#makePeaking_ Source
makePeaking_ :: Mbe -> MakePeaking -> FFIAudioSnapshot -> Effect Unit
#makePeriodicOsc_ Source
makePeriodicOsc_ :: Mbe -> MakePeriodicOsc -> FFIAudioSnapshot -> Effect Unit
#makePlayBuf_ Source
makePlayBuf_ :: Mbe -> MakePlayBuf -> FFIAudioSnapshot -> Effect Unit
#makeRecorder_ Source
makeRecorder_ :: Mbe -> MakeRecorder -> FFIAudioSnapshot -> Effect Unit
#makeSawtoothOsc_ Source
makeSawtoothOsc_ :: Mbe -> MakeSawtoothOsc -> FFIAudioSnapshot -> Effect Unit
#makeSinOsc_ Source
makeSinOsc_ :: Mbe -> MakeSinOsc -> FFIAudioSnapshot -> Effect Unit
#makeSpeaker_ Source
makeSpeaker_ :: MakeSpeaker -> FFIAudioSnapshot -> Effect Unit
#makeSquareOsc_ Source
makeSquareOsc_ :: Mbe -> MakeSquareOsc -> FFIAudioSnapshot -> Effect Unit
#makeStereoPanner_ Source
makeStereoPanner_ :: Mbe -> MakeStereoPanner -> FFIAudioSnapshot -> Effect Unit
#makeTriangleOsc_ Source
makeTriangleOsc_ :: Mbe -> MakeTriangleOsc -> FFIAudioSnapshot -> Effect Unit
#makeWaveShaper_ Source
makeWaveShaper_ :: Mbe -> MakeWaveShaper -> FFIAudioSnapshot -> Effect Unit
#setBuffer_ Source
setBuffer_ :: SetBuffer -> FFIAudioSnapshot -> Effect Unit
#setDuration_ Source
setDuration_ :: Mbe -> SetDuration -> FFIAudioSnapshot -> Effect Unit
#setLoopStart_ Source
setLoopStart_ :: SetLoopStart -> FFIAudioSnapshot -> Effect Unit
#setLoopEnd_ Source
setLoopEnd_ :: SetLoopEnd -> FFIAudioSnapshot -> Effect Unit
#setOffset_ Source
setOffset_ :: SetOffset -> FFIAudioSnapshot -> Effect Unit
#setFrequency_ Source
setFrequency_ :: SetFrequency -> FFIAudioSnapshot -> Effect Unit
#setAttack_ Source
setAttack_ :: SetAttack -> FFIAudioSnapshot -> Effect Unit
#setRelease_ Source
setRelease_ :: SetRelease -> FFIAudioSnapshot -> Effect Unit
#setThreshold_ Source
setThreshold_ :: SetThreshold -> FFIAudioSnapshot -> Effect Unit