From 02d1523a0f518eb8baaf74a7328bea86c50fe74a Mon Sep 17 00:00:00 2001 From: michal Date: Wed, 11 Jun 2025 11:57:09 +0200 Subject: [PATCH] docs: integrated few-line pages into their main objects --- .../audiodocs/docs/core/audio-context.mdx | 18 ++++++- .../docs/core/base-audio-context.mdx | 51 +++++++++++++++++-- .../audio-buffer-source-node-options.mdx | 13 ----- .../docs/types/audio-context-options.mdx | 13 ----- .../audiodocs/docs/types/context-state.mdx | 20 -------- .../docs/types/periodic-wave-constraints.mdx | 14 ----- packages/audiodocs/src/css/colors.css | 2 +- 7 files changed, 66 insertions(+), 65 deletions(-) delete mode 100644 packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx delete mode 100644 packages/audiodocs/docs/types/audio-context-options.mdx delete mode 100644 packages/audiodocs/docs/types/context-state.mdx delete mode 100644 packages/audiodocs/docs/types/periodic-wave-constraints.mdx diff --git a/packages/audiodocs/docs/core/audio-context.mdx b/packages/audiodocs/docs/core/audio-context.mdx index e9913cecd..be313bd2d 100644 --- a/packages/audiodocs/docs/core/audio-context.mdx +++ b/packages/audiodocs/docs/core/audio-context.mdx @@ -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 @@ -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`. + + +## Remarks + +### `AudioContextOptions` + +
+ +`AudioContextOptions` is a dictionary object specifies sample rate for the new context. + +```jsx +interface AudioContextOptions { + sampleRate: number; +} +``` +
\ No newline at end of file diff --git a/packages/audiodocs/docs/core/base-audio-context.mdx b/packages/audiodocs/docs/core/base-audio-context.mdx index 600352c33..bbda9d843 100644 --- a/packages/audiodocs/docs/core/base-audio-context.mdx +++ b/packages/audiodocs/docs/core/base-audio-context.mdx @@ -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. | | | `destination` | `AudioDestinationNode` | Final output destination associated with the context. | | | `sampleRate` | `number` | Float value representing the sample rate (in samples per seconds) used by all nodes in this context. | | -| `state` | [`ContextState`](/types/context-state) | Enumerated value represents the current state of the context. | | +| `state` | [`ContextState`](/core/base-audio-context#contextstate) | Enumerated value represents the current state of the context. | | ## Methods @@ -84,7 +84,7 @@ The above method lets you create [`AudioBufferSourceNode`](/sources/audio-buffer | Parameters | Type | Description | | :---: | :---: | :---- | -| `pitchCorrection` | [`AudioBufferSourceNodeOptions`](/types/audio-buffer-source-node-options) | Dictionary object that specifies if pitch correction has to be available. | +| `pitchCorrection` | [`AudioBufferSourceNodeOptions`](/core/base-audio-context#audiobuffersourcenodeoptions) | Dictionary object that specifies if pitch correction has to be available. | #### Returns `AudioBufferSourceNode`. @@ -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` | [`PeriodicWaveConstraints`](/types/periodic-wave-constraints) | An object that specifies if normalization is disabled. | +| `constraints` | [`PeriodicWaveConstraints`](/core/base-audio-context#periodicwaveconstraints) | An object that specifies if normalization is disabled. | #### Errors @@ -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` + +
+ +**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). +
+ +### `AudioBufferSourceNodeOptions` + +
+ +`AudioBufferSourceNodeOptions` is a dictionary object specifies if pitch correction algorithm has to be available. + +```jsx +interface AudioBufferSourceNodeOptions { + pitchCorrection: boolean +} +``` +
+ +### `PeriodicWaveConstraints` + +
+ +`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; +} +``` +
\ No newline at end of file diff --git a/packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx b/packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx deleted file mode 100644 index fff7dbf5e..000000000 --- a/packages/audiodocs/docs/types/audio-buffer-source-node-options.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -sidebar_position: 1 ---- - -# AudioBufferSourceNodeOptions - -`AudioBufferSourceNodeOptions` is a dictionary object specifies if pitch correction algorithm has to be available. - -```jsx -interface AudioBufferSourceNodeOptions { - pitchCorrection: boolean -} -``` diff --git a/packages/audiodocs/docs/types/audio-context-options.mdx b/packages/audiodocs/docs/types/audio-context-options.mdx deleted file mode 100644 index 5f4172f44..000000000 --- a/packages/audiodocs/docs/types/audio-context-options.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -sidebar_position: 2 ---- - -# AudioContextOptions - -`AudioContextOptions` is a dictionary object specifies sample rate for the new context. - -```jsx -interface AudioContextOptions { - sampleRate: number; -} -``` diff --git a/packages/audiodocs/docs/types/context-state.mdx b/packages/audiodocs/docs/types/context-state.mdx deleted file mode 100644 index a68e213cd..000000000 --- a/packages/audiodocs/docs/types/context-state.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -sidebar_position: 5 ---- - -# ContextState - -`ContextState` type represents state of the [`BaseAudioContext`](/core/base-audio-context). - -**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). diff --git a/packages/audiodocs/docs/types/periodic-wave-constraints.mdx b/packages/audiodocs/docs/types/periodic-wave-constraints.mdx deleted file mode 100644 index c9092e401..000000000 --- a/packages/audiodocs/docs/types/periodic-wave-constraints.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -sidebar_position: 7 ---- - -# PeriodicWaveConstraints - -`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; -} -``` diff --git a/packages/audiodocs/src/css/colors.css b/packages/audiodocs/src/css/colors.css index bd73bca9c..8338e891f 100644 --- a/packages/audiodocs/src/css/colors.css +++ b/packages/audiodocs/src/css/colors.css @@ -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);