-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathOfflineAudioContext.res
More file actions
58 lines (47 loc) · 1.69 KB
/
Copy pathOfflineAudioContext.res
File metadata and controls
58 lines (47 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
include BaseAudioContext.Impl({type t = WebAudioTypes.offlineAudioContext})
/**
`fromOptions(offlineAudioContextOptions)`
Creates a new `OfflineAudioContext` from `offlineAudioContextOptions`.
```res
let context = OfflineAudioContext.fromOptions(myOfflineAudioContextOptions)
```
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext)
*/
@new
external fromOptions: WebAudioTypes.offlineAudioContextOptions => WebAudioTypes.offlineAudioContext =
"OfflineAudioContext"
/**
`fromChannelCountLengthAndSampleRate(~numberOfChannels: int, ~length: int, ~sampleRate: float)`
Creates a new `OfflineAudioContext` from explicit channel, length, and sample-rate values.
```res
let context =
OfflineAudioContext.fromChannelCountLengthAndSampleRate(
~numberOfChannels=2,
~length=44_100,
~sampleRate=44_100.,
)
```
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext)
*/
@new
external fromChannelCountLengthAndSampleRate: (
~numberOfChannels: int,
~length: int,
~sampleRate: float,
) => WebAudioTypes.offlineAudioContext = "OfflineAudioContext"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/startRendering)
*/
@send
external startRendering: WebAudioTypes.offlineAudioContext => promise<WebAudioTypes.audioBuffer> =
"startRendering"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/resume)
*/
@send
external resume: WebAudioTypes.offlineAudioContext => promise<unit> = "resume"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/OfflineAudioContext/suspend)
*/
@send
external suspend: (WebAudioTypes.offlineAudioContext, float) => promise<unit> = "suspend"