Skip to content

Docs/few line pages integration #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/audiodocs/docs/core/audio-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is responsible for supervising and managing audio-processing graph.

`new AudioContext()`

[`new AudioContext(options: AudioContextOptions)`](/types/audio-context-options)
[`new AudioContext(options: AudioContextOptions)`](/core/audio-context#audiocontextoptions)

#### Errors

Expand Down Expand Up @@ -39,3 +39,19 @@ It is useful when your application will not use audio for a while.
The above method lets resume time progression in audio context that previously has been suspended.

#### Returns `Promise<undefined>`.


## Remarks

### `AudioContextOptions`

<details>

`AudioContextOptions` is a dictionary object specifies sample rate for the new context.

```jsx
interface AudioContextOptions {
sampleRate: number;
}
```
</details>
51 changes: 48 additions & 3 deletions packages/audiodocs/docs/core/base-audio-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Concept of system-level audio callback does not apply to `OfflineAudioContext`.
| `currentTime` | `number` | Double value representing an ever-increasing hardware time in seconds, starting from 0. | <ReadOnly /> |
| `destination` | `AudioDestinationNode` | Final output destination associated with the context. | <ReadOnly /> |
| `sampleRate` | `number` | Float value representing the sample rate (in samples per seconds) used by all nodes in this context. | <ReadOnly /> |
| `state` | [`ContextState`](/types/context-state) | Enumerated value represents the current state of the context. | <ReadOnly /> |
| `state` | [`ContextState`](/core/base-audio-context#contextstate) | Enumerated value represents the current state of the context. | <ReadOnly /> |

## Methods

Expand Down Expand Up @@ -84,7 +84,7 @@ The above method lets you create [`AudioBufferSourceNode`](/sources/audio-buffer

| Parameters | Type | Description |
| :---: | :---: | :---- |
| `pitchCorrection` <Optional /> | [`AudioBufferSourceNodeOptions`](/types/audio-buffer-source-node-options) | Dictionary object that specifies if pitch correction has to be available. |
| `pitchCorrection` <Optional /> | [`AudioBufferSourceNodeOptions`](/core/base-audio-context#audiobuffersourcenodeoptions) | Dictionary object that specifies if pitch correction has to be available. |

#### Returns `AudioBufferSourceNode`.

Expand All @@ -108,7 +108,7 @@ The above method lets you create `PeriodicWave`.
| :---: | :---: | :---- |
| `real` | `Float32Array` | An array of cosine terms. |
| `imag` | `Float32Array` | An array of sine terms. |
| `constraints` <Optional /> | [`PeriodicWaveConstraints`](/types/periodic-wave-constraints) | An object that specifies if normalization is disabled. |
| `constraints` <Optional /> | [`PeriodicWaveConstraints`](/core/base-audio-context#periodicwaveconstraints) | An object that specifies if normalization is disabled. |

#### Errors

Expand Down Expand Up @@ -149,3 +149,48 @@ The above method lets you decode audio data file. It saves file in the device fi
#### `currentTime`

- Timer starts when context is created, stops when context is suspended.

### `ContextState`

<details>

**Acceptable values:**
- `suspended`

The audio context has been suspended (with one of [`suspend`](/core/audio-context#suspend) or `OfflineAudioContext.suspend`).

- `running`

The audio context is running normally.

- `closed`

The audio context has been closed (with [`close`](/core/audio-context#close) method).
</details>

### `AudioBufferSourceNodeOptions`

<details>

`AudioBufferSourceNodeOptions` is a dictionary object specifies if pitch correction algorithm has to be available.

```jsx
interface AudioBufferSourceNodeOptions {
pitchCorrection: boolean
}
```
</details>

### `PeriodicWaveConstraints`

<details>

`PeriodicWaveConstraints` is a dictionary object specifies whether normalization should be disabled during creating periodic wave. If not specified normalization is enabled.
If normalized, periodic wave will have maximum peak value of 1 and minimum peak value of -1.

```jsx
interface PeriodicWaveConstraints {
disableNormalization: boolean;
}
```
</details>
13 changes: 0 additions & 13 deletions packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx

This file was deleted.

13 changes: 0 additions & 13 deletions packages/audiodocs/docs/types/audio-context-options.mdx

This file was deleted.

20 changes: 0 additions & 20 deletions packages/audiodocs/docs/types/context-state.mdx

This file was deleted.

14 changes: 0 additions & 14 deletions packages/audiodocs/docs/types/periodic-wave-constraints.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/audiodocs/src/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
--swm-background-quote-green: var(--swm-green-light-40);
--swm-background-quote-red: var(--swm-red-light-40);
--swm-background-quote-yellow: var(--swm-yellow-dark-140);
--swm-background-quote-purple: var(--swm-purple-light-40);
--swm-background-quote-purple: var(--swm-purple-light-80);

/* Code snippets */
--swm-border: var(--swm-navy-light-60);
Expand Down
Loading