Skip to content
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
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/core/audio-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Creates [`MediaElementAudioSourceNode`](/docs/sources/media-element-audio-source

| Parameter | Type | Description |
| :---: | :---: | :---- |
| `mediaElement` | `HTMLMediaElement` (web) \| [`AudioTagHandle`](/docs/experimental/audio-tag#ref-handle-audiotaghandle-methods) (native) | Media element to route into the graph. On native, wait for [`onLoad`](/docs/experimental/audio-tag#props-audioprops) on `<Audio>` before calling. |
| `mediaElement` | `HTMLMediaElement` (web) \| [`AudioTagHandle`](/docs/sources/audio-tag#ref-handle-audiotaghandle-methods) (native) | Media element to route into the graph. On native, wait for [`onLoad`](/docs/sources/audio-tag#props-audioprops) on `<Audio>` before calling. |

#### Returns [`MediaElementAudioSourceNode`](/docs/sources/media-element-audio-source-node).

Expand Down
4 changes: 2 additions & 2 deletions packages/audiodocs/docs/flags/runtime-flags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ if (!isFfmpegEnabled()) {
| Area | API | Requires FFmpeg for |
| :--- | :--- | :--- |
| Streaming | [`Audio tag`](/docs/sources/audio-tag) | HLS playback |
| Playback | [`createFileSource`](/docs/core/base-audio-context#createfilesource), [`<Audio>`](/docs/experimental/audio-tag) | Remote URL streaming, HLS (`.m3u8`), local `.mp4` / `.m4a` / `.aac`. Without FFmpeg, remote sources are downloaded and decoded with miniaudio where supported. |
| Playback | `createFileSource`, [`<Audio>`](/docs/sources/audio-tag) | Remote URL streaming, HLS (`.m3u8`), local `.mp4` / `.m4a` / `.aac`. Without FFmpeg, remote sources are downloaded and decoded with miniaudio where supported. |
| Decoding | [`decodeAudioData`](/docs/utils/decoding#decodeaudiodata) | `.aac`, `.mp4`, `.m4a` (and remote URLs for any format) |
| Metadata | [`getAudioDuration`](/docs/utils/decoding#getaudioduration), [`<Audio>`](/docs/experimental/audio-tag) `preload="metadata"` | Remote `http(s):` URL duration probing |
| Metadata | [`getAudioDuration`](/docs/utils/decoding#getaudioduration), [`<Audio>`](/docs/sources/audio-tag) `preload="metadata"` | Remote `http(s):` URL duration probing |
| Recording | [`AudioRecorder`](/docs/inputs/audio-recorder) file output | **Android only:** `M4A`, `FLAC`, and `CAF` (WAV uses miniaudio). iOS uses system AVFoundation instead. |
| File utils | [`concatAudioFiles`](/docs/utils/file-concatenation#concataudiofiles) | M4A concatenation (WAV uses miniaudio) |

Expand Down
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/fundamentals/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ user experience, and maintainability. Here are some key best practices to consid

- **Suspend when not in use**: Suspend the `AudioContext` when audio is not needed to save system resources and battery life, especially on mobile devices.
Running `AudioContext` is still playing silence even if there is no playing source node connected to the [`destination`](/docs/core/base-audio-context#properties).
Additionally, on iOS devices, the state of the `AudioContext` is directly related with state of the lock screen. If running `AudioContext` exists, it is impossible to set lock screen state to [`state_paused`](/docs/system/audio-manager#lockscreeninfo).
Additionally, on iOS devices, the state of the `AudioContext` is directly related with state of the lock screen. If running `AudioContext` exists, it is impossible to set lock screen state to `state_paused`.

## React hooks vs React Native Audio API

Expand Down
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/sources/audio-tag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Only **required** field is a `source`. Callbacks default to no-ops if omitted.
| `source` | `AudioSource` | — | Asset id (`require(...)`), string URI/path, or `{ uri?, headers? }` for HTTP(S). |
| `context` | `BaseAudioContext` | — | Optional. Native: implicit [`AudioContext`](/docs/core/audio-context) when omitted. Web: unused for HTML element playback. |
| `autoPlay` | `boolean` | `false` | Start playback after load. |
| `controls` | `boolean` | `false` | When `true`, renders default [`AudioControls`](#audiocontrols) above `children`. |
| `controls` | `boolean` | `false` | When `true`, renders default `AudioControls` above `children`. |
| `loop` | `boolean` | `false` | Loop playback. |
| `muted` | `boolean` | `false` | Muted state. |
| `volume` | `number` | `1` | Linear volume passed to the underlying source. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReadOnly } from '@site/src/components/Badges';

The `MediaElementAudioSourceNode` is an [`AudioNode`](/docs/core/audio-node) that routes media playback into the audio graph.
On the web it mirrors [`AudioContext.createMediaElementSource()`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaElementSource) and accepts an `HTMLMediaElement`.
On the native it wraps a file-backed source created by the experimental [`<Audio>`](/docs/experimental/audio-tag) tag.
On the native it wraps a file-backed source created by the experimental [`<Audio>`](/docs/sources/audio-tag) tag.

## Constructor

Expand All @@ -21,7 +21,7 @@ constructor(context: BaseAudioContext, options: MediaElementAudioSourceOptions)

| Parameter | Type | Default | |
| :---: | :---: | :----: | :---- |
| `mediaElement` | `HTMLMediaElement` (web) \| [`AudioTagHandle`](/docs/experimental/audio-tag#ref-handle-audiotaghandle-methods) (native) | — | Media element whose audio is routed into the graph. On native, wait for [`onLoad`](/docs/experimental/audio-tag#props-audioprops) before constructing this node. |
| `mediaElement` | `HTMLMediaElement` (web) \| [`AudioTagHandle`](/docs/sources/audio-tag#ref-handle-audiotaghandle-methods) (native) | — | Media element whose audio is routed into the graph. On native, wait for [`onLoad`](/docs/sources/audio-tag#props-audioprops) before constructing this node. |

Or by using [`AudioContext`](/docs/core/audio-context) factory method:
[`AudioContext.createMediaElementSource()`](/docs/core/audio-context#createmediaelementsource)
Expand Down Expand Up @@ -95,7 +95,7 @@ It inherits all properties from [`AudioNode`](/docs/core/audio-node#properties).

| Name | Type | Default value | Description |
| :----: | :----: | :-------- | :------- |
| `mediaElement` <ReadOnly /> | `HTMLMediaElement` \| [`AudioTagHandle`](/docs/experimental/audio-tag#ref-handle-audiotaghandle-methods) | — | The media element routed into the audio graph. |
| `mediaElement` <ReadOnly /> | `HTMLMediaElement` \| [`AudioTagHandle`](/docs/sources/audio-tag#ref-handle-audiotaghandle-methods) | — | The media element routed into the audio graph. |

## Methods

Expand All @@ -106,4 +106,4 @@ It inherits all methods from [`AudioNode`](/docs/core/audio-node#methods).
#### Native routing

- On native, the underlying file source is disconnected from the destination when this node is created so audio is not processed twice.
- Use the same [`AudioTagHandle`](/docs/experimental/audio-tag#ref-handle-audiotaghandle-methods) for transport controls (`play`, `pause`, `seekToTime`, `volume`).
- Use the same [`AudioTagHandle`](/docs/sources/audio-tag#ref-handle-audiotaghandle-methods) for transport controls (`play`, `pause`, `seekToTime`, `volume`).
2 changes: 1 addition & 1 deletion packages/audiodocs/docs/sources/streamer-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Optional, ReadOnly } from '@site/src/components/Badges';
# StreamerNode

:::danger
Deprecated. Use the [`<Audio>`](/docs/experimental/audio-tag) element with [`MediaElementAudioSourceNode`](/docs/sources/media-element-audio-source-node) for streaming audio instead to achieve the same functionality.
Deprecated. Use the [`<Audio>`](/docs/sources/audio-tag) element with [`MediaElementAudioSourceNode`](/docs/sources/media-element-audio-source-node) for streaming audio instead to achieve the same functionality.
:::

:::caution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Add an event listener for notification actions.
| Parameter | Type | Description |
| :---------: | :------: | :------- |
| `eventName` | [`PlaybackNotificationEventName`](playback-notification-manager#playbacknotificationeventname) | The event to listen for |
| `callback` | [`SystemEventCallback`](/docs/system/audio-manager#systemeventname--remotecommandeventname) | Callback function |
| `callback` | [`SystemEventCallback`](/docs/system/audio-manager#systemeventname) | Callback function |

#### Returns [`AudioEventSubscription`](/docs/system/audio-manager#audioeventsubscription).

Expand Down
Loading