expo-audio 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/android/build.gradle +9 -7
- package/build/Audio.types.d.ts +21 -2
- package/build/Audio.types.d.ts.map +1 -1
- package/build/Audio.types.js.map +1 -1
- package/build/AudioModule.types.d.ts +48 -2
- package/build/AudioModule.types.d.ts.map +1 -1
- package/build/AudioModule.types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8.aar → 1.0.10/expo.modules.audio-1.0.10.aar} +0 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8.module → 1.0.10/expo.modules.audio-1.0.10.module} +20 -20
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.module.md5 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8.pom → 1.0.10/expo.modules.audio-1.0.10.pom} +6 -6
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.10/expo.modules.audio-1.0.10.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/Audio.types.ts +21 -2
- package/src/AudioModule.types.ts +48 -2
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.module.md5 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/audio/expo.modules.audio/1.0.8/expo.modules.audio-1.0.8.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8-sources.jar → 1.0.10/expo.modules.audio-1.0.10-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8-sources.jar.md5 → 1.0.10/expo.modules.audio-1.0.10-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8-sources.jar.sha1 → 1.0.10/expo.modules.audio-1.0.10-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8-sources.jar.sha256 → 1.0.10/expo.modules.audio-1.0.10-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/audio/expo.modules.audio/{1.0.8/expo.modules.audio-1.0.8-sources.jar.sha512 → 1.0.10/expo.modules.audio-1.0.10-sources.jar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 1.0.10 — 2025-09-08
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 1.0.9 — 2025-09-03
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- [Android] Bump media3 version to 1.8.0. ([#39187](https://github.com/expo/expo/pull/39187) by [@behenate](https://github.com/behenate))
|
|
22
|
+
|
|
13
23
|
## 1.0.8 — 2025-09-02
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'expo.modules.audio'
|
|
7
|
-
version = '1.0.
|
|
7
|
+
version = '1.0.10'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.audio"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "1.0.
|
|
13
|
+
versionName "1.0.10"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
compileOptions {
|
|
@@ -24,9 +24,11 @@ repositories {
|
|
|
24
24
|
|
|
25
25
|
dependencies {
|
|
26
26
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
implementation
|
|
30
|
-
implementation
|
|
31
|
-
implementation
|
|
27
|
+
|
|
28
|
+
def androidxMedia3Version = "1.8.0"
|
|
29
|
+
implementation "androidx.media3:media3-exoplayer:$androidxMedia3Version"
|
|
30
|
+
implementation "androidx.media3:media3-exoplayer-dash:$androidxMedia3Version"
|
|
31
|
+
implementation "androidx.media3:media3-datasource-okhttp:$androidxMedia3Version"
|
|
32
|
+
implementation "androidx.media3:media3-exoplayer-hls:$androidxMedia3Version"
|
|
33
|
+
implementation "androidx.media3:media3-exoplayer-smoothstreaming:$androidxMedia3Version"
|
|
32
34
|
}
|
package/build/Audio.types.d.ts
CHANGED
|
@@ -21,8 +21,27 @@ export type AudioSource = string | number | null | {
|
|
|
21
21
|
*/
|
|
22
22
|
export type AudioPlayerOptions = {
|
|
23
23
|
/**
|
|
24
|
-
* How often (in milliseconds) to emit playback status updates.
|
|
25
|
-
*
|
|
24
|
+
* How often (in milliseconds) to emit playback status updates. Defaults to 500ms.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
29
|
+
*
|
|
30
|
+
* export default function App() {
|
|
31
|
+
* const player = useAudioPlayer(source);
|
|
32
|
+
*
|
|
33
|
+
* // High-frequency updates for smooth progress bars
|
|
34
|
+
* const player = useAudioPlayer(source, { updateInterval: 100 });
|
|
35
|
+
*
|
|
36
|
+
* // Standard updates (default behavior)
|
|
37
|
+
* const player = useAudioPlayer(source, { updateInterval: 500 });
|
|
38
|
+
*
|
|
39
|
+
* // Low-frequency updates for better performance
|
|
40
|
+
* const player = useAudioPlayer(source, { updateInterval: 1000 });
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @default 500ms
|
|
26
45
|
*
|
|
27
46
|
* @platform ios
|
|
28
47
|
* @platform android
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Audio.types.d.ts","sourceRoot":"","sources":["../src/Audio.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGrE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,IAAI,GACJ;IACE;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEN;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B
|
|
1
|
+
{"version":3,"file":"Audio.types.d.ts","sourceRoot":"","sources":["../src/Audio.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGrE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,IAAI,GACJ;IACE;;;OAGG;IACH,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C,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAClC;;OAEG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAClC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IACnC;;;;OAIG;IACH,uBAAuB,EAAE,uBAAuB,CAAC;IACjD;;;;;OAKG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,UAAU,GAAG,YAAY,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,YAAY,CAAC"}
|
package/build/Audio.types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Audio.types.js","sourceRoot":"","sources":["../src/Audio.types.ts"],"names":[],"mappings":"","sourcesContent":["import { AudioQuality, IOSOutputFormat } from './RecordingConstants';\n\n// @docsMissing\nexport type AudioSource =\n | string\n | number\n | null\n | {\n /**\n * A string representing the resource identifier for the audio,\n * which could be an HTTPS address, a local file path, or the name of a static audio file resource.\n */\n uri?: string;\n /**\n * The asset ID of a local audio asset, acquired with the `require` function.\n * This property is exclusive with the `uri` property. When both are present, the `assetId` will be ignored.\n */\n assetId?: number;\n /**\n * An object representing the HTTP headers to send along with the request for a remote audio source.\n * On web requires the `Access-Control-Allow-Origin` header returned by the server to include the current domain.\n */\n headers?: Record<string, string>;\n };\n\n/**\n * Options for configuring audio player behavior.\n */\nexport type AudioPlayerOptions = {\n /**\n * How often (in milliseconds) to emit playback status updates.\n * @default 500\n *\n * @platform ios\n * @platform android\n * @platform web\n */\n updateInterval?: number;\n /**\n * If set to `true`, the system will attempt to download the resource to the device before loading.\n * This value defaults to `false`.\n *\n * Works with:\n * - Local assets from `require('path/to/file')`\n * - Remote HTTP/HTTPS URLs\n * - Asset objects\n *\n * When enabled, this ensures the audio file is fully downloaded before playback begins.\n * This can improve playback performance and reduce buffering, especially for users\n * managing multiple audio players simultaneously.\n *\n * On Android and iOS, this will download the audio file to the device's tmp directory before playback begins.\n * The system will purge the file at its discretion.\n *\n * On web, this will download the audio file to the user's device memory and make it available for the user to play.\n * The system will usually purge the file from memory after a reload or on memory pressure.\n * On web, CORS restrictions apply to the blob url, so you need to make sure the server returns the `Access-Control-Allow-Origin` header.\n *\n * @platform ios\n * @platform web\n * @platform android\n */\n downloadFirst?: boolean;\n /**\n * Determines the [cross origin policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/crossorigin) used by the underlying native view on web.\n * If `undefined` (default), does not use CORS at all. If set to `'anonymous'`, the audio will be loaded with CORS enabled.\n * Note that some audio may not play if CORS is enabled, depending on the CDN settings.\n * If you encounter issues, consider adjusting the `crossOrigin` property.\n *\n *\n * @platform web\n * @default undefined\n */\n crossOrigin?: 'anonymous' | 'use-credentials';\n /**\n * If set to `true`, the audio session will not be deactivated when this player pauses or finishes playback.\n * This prevents interrupting other audio sources (like videos) when the audio ends.\n *\n * Useful for sound effects that should not interfere with ongoing video playback or other audio.\n * The audio session for this player will not be deactivated automatically when the player finishes playback.\n *\n * > **Note:** If needed, you can manually deactivate the audio session using `setIsAudioActiveAsync(false)`.\n *\n * @platform ios\n * @default false\n */\n keepAudioSessionActive?: boolean;\n};\n\n/**\n * @deprecated Use `AudioPlayerOptions` instead.\n * Options for audio loading behavior.\n */\nexport type AudioLoadOptions = AudioPlayerOptions;\n\n/**\n * Represents an available audio input device for recording.\n *\n * This type describes audio input sources like built-in microphones, external microphones,\n * or other audio input devices that can be used for recording. Each input has an identifying\n * information that can be used to select the preferred recording source.\n */\nexport type RecordingInput = {\n /** Human-readable name of the audio input device. */\n name: string;\n /** Type or category of the input device (for example, 'Built-in Microphone', 'External Microphone'). */\n type: string;\n /** Unique identifier for the input device, used to select the input ('Built-in Microphone', 'External Microphone') for recording. */\n uid: string;\n};\n\n/**\n * Pitch correction quality settings for audio playback rate changes.\n *\n * When changing playback rate, pitch correction can be applied to maintain the original pitch.\n * Different quality levels offer trade-offs between processing power and audio quality.\n *\n * @platform ios\n */\nexport type PitchCorrectionQuality = 'low' | 'medium' | 'high';\n\n/**\n * Comprehensive status information for an `AudioPlayer`.\n *\n * This object contains all the current state information about audio playback,\n * including playback position, duration, loading state, and playback settings.\n * Used by `useAudioPlayerStatus()` to provide real-time status updates.\n */\nexport type AudioStatus = {\n /** Unique identifier for the player instance. */\n id: number;\n /** Current playback position in seconds. */\n currentTime: number;\n /** String representation of the player's internal playback state. */\n playbackState: string;\n /** String representation of the player's time control status (playing/paused/waiting). */\n timeControlStatus: string;\n /** Reason why the player is waiting to play (if applicable). */\n reasonForWaitingToPlay: string;\n /** Whether the player is currently muted. */\n mute: boolean;\n /** Total duration of the audio in seconds, or 0 if not yet determined. */\n duration: number;\n /** Whether the audio is currently playing. */\n playing: boolean;\n /** Whether the audio is set to loop when it reaches the end. */\n loop: boolean;\n /** Whether the audio just finished playing. */\n didJustFinish: boolean;\n /** Whether the player is currently buffering data. */\n isBuffering: boolean;\n /** Whether the audio has finished loading and is ready to play. */\n isLoaded: boolean;\n /** Current playback rate (1.0 = normal speed). */\n playbackRate: number;\n /** Whether pitch correction is enabled for rate changes. */\n shouldCorrectPitch: boolean;\n};\n\n/**\n * Status information for recording operations from the event system.\n *\n * This type represents the status data emitted by `recordingStatusUpdate` events.\n * It contains high-level information about the recording session and any errors.\n * Used internally by the event system. Most users should use `useAudioRecorderState()` instead.\n */\nexport type RecordingStatus = {\n /** Unique identifier for the recording session. */\n id: number;\n /** Whether the recording has finished (stopped). */\n isFinished: boolean;\n /** Whether an error occurred during recording. */\n hasError: boolean;\n /** Error message if an error occurred, `null` otherwise. */\n error: string | null;\n /** File URL of the completed recording, if available. */\n url: string | null;\n};\n\n/**\n * Current state information for an `AudioRecorder`.\n *\n * This object contains detailed information about the recorder's current state,\n * including recording status, duration, and technical details. This is what you get\n * when calling `recorder.getStatus()` or using `useAudioRecorderState()`.\n */\nexport type RecorderState = {\n /** Whether the recorder is ready and able to record. */\n canRecord: boolean;\n /** Whether recording is currently in progress. */\n isRecording: boolean;\n /** Duration of the current recording in milliseconds. */\n durationMillis: number;\n /** Whether the media services have been reset (typically indicates a system interruption). */\n mediaServicesDidReset: boolean;\n /** Current audio level/volume being recorded (if metering is enabled). */\n metering?: number;\n /** File URL where the recording will be saved, if available. */\n url: string | null;\n};\n\n/**\n * Audio output format options for Android recording.\n *\n * Specifies the container format for recorded audio files on Android.\n * Different formats have different compatibility and compression characteristics.\n *\n * @platform android\n */\nexport type AndroidOutputFormat =\n | 'default'\n | '3gp'\n | 'mpeg4'\n | 'amrnb'\n | 'amrwb'\n | 'aac_adts'\n | 'mpeg2ts'\n | 'webm';\n\n/**\n * Audio encoder options for Android recording.\n *\n * Specifies the audio codec used to encode recorded audio on Android.\n * Different encoders offer different quality, compression, and compatibility trade-offs.\n *\n * @platform android\n */\nexport type AndroidAudioEncoder = 'default' | 'amr_nb' | 'amr_wb' | 'aac' | 'he_aac' | 'aac_eld';\n\n/**\n * Bit rate strategies for audio encoding.\n *\n * Determines how the encoder manages bit rate during recording, affecting\n * file size consistency and quality characteristics.\n */\nexport type BitRateStrategy = 'constant' | 'longTermAverage' | 'variableConstrained' | 'variable';\n\n/**\n * Options for controlling how audio recording is started.\n */\nexport type RecordingStartOptions = {\n /**\n * The duration in seconds after which recording should automatically stop.\n * If not provided, recording continues until manually stopped.\n *\n * @platform ios\n * @platform android\n * @platform web\n */\n forDuration?: number;\n /**\n * The time in seconds to wait before starting the recording.\n * If not provided, recording starts immediately.\n *\n * **Platform behavior:**\n * - Android: Ignored, recording starts immediately\n * - iOS: Uses native AVAudioRecorder.record(atTime:) for precise timing.\n * - Web: Ignored, recording starts immediately\n *\n * > **warning** On iOS, the recording process starts immediately (you'll see status updates),\n * but actual audio capture begins after the specified delay. This is not a countdown, since\n * the recorder is active but silent during the delay period.\n *\n * @platform ios\n */\n atTime?: number;\n};\n\nexport type RecordingOptions = {\n /**\n * A boolean that determines whether audio level information will be part of the status object under the \"metering\" key.\n */\n isMeteringEnabled?: boolean;\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate: number;\n /**\n * The desired number of channels.\n *\n * @example 2\n */\n numberOfChannels: number;\n /**\n * The desired bit rate.\n *\n * @example 128000\n */\n bitRate: number;\n /**\n * Recording options for the Android platform.\n * @platform android\n */\n android: RecordingOptionsAndroid;\n /**\n * Recording options for the iOS platform.\n * @platform ios\n */\n ios: RecordingOptionsIos;\n /**\n * Recording options for the Web platform.\n * @platform web\n */\n web?: RecordingOptionsWeb;\n};\n\n/**\n * Recording options for the web.\n *\n * Web recording uses the `MediaRecorder` API, which has different capabilities\n * compared to native platforms. These options map directly to `MediaRecorder` settings.\n *\n * @platform web\n */\nexport type RecordingOptionsWeb = {\n /** MIME type for the recording (for example, 'audio/webm', 'audio/mp4'). */\n mimeType?: string;\n /** Target bits per second for the recording. */\n bitsPerSecond?: number;\n};\n\n/**\n * Recording configuration options specific to iOS.\n *\n * iOS recording uses `AVAudioRecorder` with extensive format and quality options.\n * These settings provide fine-grained control over the recording characteristics.\n *\n * @platform ios\n */\nexport type RecordingOptionsIos = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`IOSOutputFormat`](#iosoutputformat) enum for all valid values.\n */\n outputFormat?: string | IOSOutputFormat | number;\n /**\n * The desired audio quality. See the [`AudioQuality`](#audioquality) enum for all valid values.\n */\n audioQuality: AudioQuality | number;\n /**\n * The desired bit rate strategy. See the next section for an enumeration of all valid values of `bitRateStrategy`.\n */\n bitRateStrategy?: number;\n /**\n * The desired bit depth hint.\n *\n * @example 16\n */\n bitDepthHint?: number;\n /**\n * The desired PCM bit depth.\n *\n * @example 16\n */\n linearPCMBitDepth?: number;\n /**\n * A boolean describing if the PCM data should be formatted in big endian.\n */\n linearPCMIsBigEndian?: boolean;\n /**\n * A boolean describing if the PCM data should be encoded in floating point or integral values.\n */\n linearPCMIsFloat?: boolean;\n};\n\n/**\n * Recording configuration options specific to Android.\n *\n * Android recording uses `MediaRecorder` with options for format, encoder, and file constraints.\n * These settings control the output format and quality characteristics.\n *\n * @platform android\n */\nexport type RecordingOptionsAndroid = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`AndroidOutputFormat`](#androidoutputformat) enum for all valid values.\n */\n outputFormat: AndroidOutputFormat;\n /**\n * The desired audio encoder. See the [`AndroidAudioEncoder`](#androidaudioencoder) enum for all valid values.\n */\n audioEncoder: AndroidAudioEncoder;\n /**\n * The desired maximum file size in bytes, after which the recording will stop (but `stopAndUnloadAsync()` must still\n * be called after this point).\n *\n * @example\n * `65536`\n */\n maxFileSize?: number;\n};\n\nexport type AudioMode = {\n /**\n * Determines if audio playback is allowed when the device is in silent mode.\n *\n * @platform ios\n */\n playsInSilentMode: boolean;\n /**\n * Determines how the audio session interacts with other sessions.\n *\n * @platform ios\n */\n interruptionMode: InterruptionMode;\n /**\n * Determines how the audio session interacts with other sessions on Android.\n *\n * @platform android\n */\n interruptionModeAndroid: InterruptionModeAndroid;\n /**\n * Whether the audio session allows recording.\n *\n * @default false\n * @platform ios\n */\n allowsRecording: boolean;\n /**\n * Whether the audio session stays active when the app moves to the background.\n * @default false\n */\n shouldPlayInBackground: boolean;\n /**\n * Whether the audio should route through the earpiece.\n * @platform android\n */\n shouldRouteThroughEarpiece: boolean;\n};\n\n/**\n * Audio interruption behavior modes for iOS.\n *\n * Controls how your app's audio interacts with other apps' audio when interruptions occur.\n * This affects what happens when phone calls, notifications, or other apps play audio.\n *\n * @platform ios\n */\nexport type InterruptionMode = 'mixWithOthers' | 'doNotMix' | 'duckOthers';\n\n/**\n * Audio interruption behavior modes for Android.\n *\n * Controls how your app's audio interacts with other apps' audio on Android.\n * Note that Android doesn't support 'mixWithOthers' mode; audio focus is more strictly managed.\n *\n * @platform android\n */\nexport type InterruptionModeAndroid = 'doNotMix' | 'duckOthers';\n"]}
|
|
1
|
+
{"version":3,"file":"Audio.types.js","sourceRoot":"","sources":["../src/Audio.types.ts"],"names":[],"mappings":"","sourcesContent":["import { AudioQuality, IOSOutputFormat } from './RecordingConstants';\n\n// @docsMissing\nexport type AudioSource =\n | string\n | number\n | null\n | {\n /**\n * A string representing the resource identifier for the audio,\n * which could be an HTTPS address, a local file path, or the name of a static audio file resource.\n */\n uri?: string;\n /**\n * The asset ID of a local audio asset, acquired with the `require` function.\n * This property is exclusive with the `uri` property. When both are present, the `assetId` will be ignored.\n */\n assetId?: number;\n /**\n * An object representing the HTTP headers to send along with the request for a remote audio source.\n * On web requires the `Access-Control-Allow-Origin` header returned by the server to include the current domain.\n */\n headers?: Record<string, string>;\n };\n\n/**\n * Options for configuring audio player behavior.\n */\nexport type AudioPlayerOptions = {\n /**\n * How often (in milliseconds) to emit playback status updates. Defaults to 500ms.\n *\n * @example\n * ```tsx\n * import { useAudioPlayer } from 'expo-audio';\n *\n * export default function App() {\n * const player = useAudioPlayer(source);\n *\n * // High-frequency updates for smooth progress bars\n * const player = useAudioPlayer(source, { updateInterval: 100 });\n *\n * // Standard updates (default behavior)\n * const player = useAudioPlayer(source, { updateInterval: 500 });\n *\n * // Low-frequency updates for better performance\n * const player = useAudioPlayer(source, { updateInterval: 1000 });\n * }\n * ```\n *\n * @default 500ms\n *\n * @platform ios\n * @platform android\n * @platform web\n */\n updateInterval?: number;\n /**\n * If set to `true`, the system will attempt to download the resource to the device before loading.\n * This value defaults to `false`.\n *\n * Works with:\n * - Local assets from `require('path/to/file')`\n * - Remote HTTP/HTTPS URLs\n * - Asset objects\n *\n * When enabled, this ensures the audio file is fully downloaded before playback begins.\n * This can improve playback performance and reduce buffering, especially for users\n * managing multiple audio players simultaneously.\n *\n * On Android and iOS, this will download the audio file to the device's tmp directory before playback begins.\n * The system will purge the file at its discretion.\n *\n * On web, this will download the audio file to the user's device memory and make it available for the user to play.\n * The system will usually purge the file from memory after a reload or on memory pressure.\n * On web, CORS restrictions apply to the blob url, so you need to make sure the server returns the `Access-Control-Allow-Origin` header.\n *\n * @platform ios\n * @platform web\n * @platform android\n */\n downloadFirst?: boolean;\n /**\n * Determines the [cross origin policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/crossorigin) used by the underlying native view on web.\n * If `undefined` (default), does not use CORS at all. If set to `'anonymous'`, the audio will be loaded with CORS enabled.\n * Note that some audio may not play if CORS is enabled, depending on the CDN settings.\n * If you encounter issues, consider adjusting the `crossOrigin` property.\n *\n *\n * @platform web\n * @default undefined\n */\n crossOrigin?: 'anonymous' | 'use-credentials';\n /**\n * If set to `true`, the audio session will not be deactivated when this player pauses or finishes playback.\n * This prevents interrupting other audio sources (like videos) when the audio ends.\n *\n * Useful for sound effects that should not interfere with ongoing video playback or other audio.\n * The audio session for this player will not be deactivated automatically when the player finishes playback.\n *\n * > **Note:** If needed, you can manually deactivate the audio session using `setIsAudioActiveAsync(false)`.\n *\n * @platform ios\n * @default false\n */\n keepAudioSessionActive?: boolean;\n};\n\n/**\n * @deprecated Use `AudioPlayerOptions` instead.\n * Options for audio loading behavior.\n */\nexport type AudioLoadOptions = AudioPlayerOptions;\n\n/**\n * Represents an available audio input device for recording.\n *\n * This type describes audio input sources like built-in microphones, external microphones,\n * or other audio input devices that can be used for recording. Each input has an identifying\n * information that can be used to select the preferred recording source.\n */\nexport type RecordingInput = {\n /** Human-readable name of the audio input device. */\n name: string;\n /** Type or category of the input device (for example, 'Built-in Microphone', 'External Microphone'). */\n type: string;\n /** Unique identifier for the input device, used to select the input ('Built-in Microphone', 'External Microphone') for recording. */\n uid: string;\n};\n\n/**\n * Pitch correction quality settings for audio playback rate changes.\n *\n * When changing playback rate, pitch correction can be applied to maintain the original pitch.\n * Different quality levels offer trade-offs between processing power and audio quality.\n *\n * @platform ios\n */\nexport type PitchCorrectionQuality = 'low' | 'medium' | 'high';\n\n/**\n * Comprehensive status information for an `AudioPlayer`.\n *\n * This object contains all the current state information about audio playback,\n * including playback position, duration, loading state, and playback settings.\n * Used by `useAudioPlayerStatus()` to provide real-time status updates.\n */\nexport type AudioStatus = {\n /** Unique identifier for the player instance. */\n id: number;\n /** Current playback position in seconds. */\n currentTime: number;\n /** String representation of the player's internal playback state. */\n playbackState: string;\n /** String representation of the player's time control status (playing/paused/waiting). */\n timeControlStatus: string;\n /** Reason why the player is waiting to play (if applicable). */\n reasonForWaitingToPlay: string;\n /** Whether the player is currently muted. */\n mute: boolean;\n /** Total duration of the audio in seconds, or 0 if not yet determined. */\n duration: number;\n /** Whether the audio is currently playing. */\n playing: boolean;\n /** Whether the audio is set to loop when it reaches the end. */\n loop: boolean;\n /** Whether the audio just finished playing. */\n didJustFinish: boolean;\n /** Whether the player is currently buffering data. */\n isBuffering: boolean;\n /** Whether the audio has finished loading and is ready to play. */\n isLoaded: boolean;\n /** Current playback rate (1.0 = normal speed). */\n playbackRate: number;\n /** Whether pitch correction is enabled for rate changes. */\n shouldCorrectPitch: boolean;\n};\n\n/**\n * Status information for recording operations from the event system.\n *\n * This type represents the status data emitted by `recordingStatusUpdate` events.\n * It contains high-level information about the recording session and any errors.\n * Used internally by the event system. Most users should use `useAudioRecorderState()` instead.\n */\nexport type RecordingStatus = {\n /** Unique identifier for the recording session. */\n id: number;\n /** Whether the recording has finished (stopped). */\n isFinished: boolean;\n /** Whether an error occurred during recording. */\n hasError: boolean;\n /** Error message if an error occurred, `null` otherwise. */\n error: string | null;\n /** File URL of the completed recording, if available. */\n url: string | null;\n};\n\n/**\n * Current state information for an `AudioRecorder`.\n *\n * This object contains detailed information about the recorder's current state,\n * including recording status, duration, and technical details. This is what you get\n * when calling `recorder.getStatus()` or using `useAudioRecorderState()`.\n */\nexport type RecorderState = {\n /** Whether the recorder is ready and able to record. */\n canRecord: boolean;\n /** Whether recording is currently in progress. */\n isRecording: boolean;\n /** Duration of the current recording in milliseconds. */\n durationMillis: number;\n /** Whether the media services have been reset (typically indicates a system interruption). */\n mediaServicesDidReset: boolean;\n /** Current audio level/volume being recorded (if metering is enabled). */\n metering?: number;\n /** File URL where the recording will be saved, if available. */\n url: string | null;\n};\n\n/**\n * Audio output format options for Android recording.\n *\n * Specifies the container format for recorded audio files on Android.\n * Different formats have different compatibility and compression characteristics.\n *\n * @platform android\n */\nexport type AndroidOutputFormat =\n | 'default'\n | '3gp'\n | 'mpeg4'\n | 'amrnb'\n | 'amrwb'\n | 'aac_adts'\n | 'mpeg2ts'\n | 'webm';\n\n/**\n * Audio encoder options for Android recording.\n *\n * Specifies the audio codec used to encode recorded audio on Android.\n * Different encoders offer different quality, compression, and compatibility trade-offs.\n *\n * @platform android\n */\nexport type AndroidAudioEncoder = 'default' | 'amr_nb' | 'amr_wb' | 'aac' | 'he_aac' | 'aac_eld';\n\n/**\n * Bit rate strategies for audio encoding.\n *\n * Determines how the encoder manages bit rate during recording, affecting\n * file size consistency and quality characteristics.\n */\nexport type BitRateStrategy = 'constant' | 'longTermAverage' | 'variableConstrained' | 'variable';\n\n/**\n * Options for controlling how audio recording is started.\n */\nexport type RecordingStartOptions = {\n /**\n * The duration in seconds after which recording should automatically stop.\n * If not provided, recording continues until manually stopped.\n *\n * @platform ios\n * @platform android\n * @platform web\n */\n forDuration?: number;\n /**\n * The time in seconds to wait before starting the recording.\n * If not provided, recording starts immediately.\n *\n * **Platform behavior:**\n * - Android: Ignored, recording starts immediately\n * - iOS: Uses native AVAudioRecorder.record(atTime:) for precise timing.\n * - Web: Ignored, recording starts immediately\n *\n * > **warning** On iOS, the recording process starts immediately (you'll see status updates),\n * but actual audio capture begins after the specified delay. This is not a countdown, since\n * the recorder is active but silent during the delay period.\n *\n * @platform ios\n */\n atTime?: number;\n};\n\nexport type RecordingOptions = {\n /**\n * A boolean that determines whether audio level information will be part of the status object under the \"metering\" key.\n */\n isMeteringEnabled?: boolean;\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate: number;\n /**\n * The desired number of channels.\n *\n * @example 2\n */\n numberOfChannels: number;\n /**\n * The desired bit rate.\n *\n * @example 128000\n */\n bitRate: number;\n /**\n * Recording options for the Android platform.\n * @platform android\n */\n android: RecordingOptionsAndroid;\n /**\n * Recording options for the iOS platform.\n * @platform ios\n */\n ios: RecordingOptionsIos;\n /**\n * Recording options for the Web platform.\n * @platform web\n */\n web?: RecordingOptionsWeb;\n};\n\n/**\n * Recording options for the web.\n *\n * Web recording uses the `MediaRecorder` API, which has different capabilities\n * compared to native platforms. These options map directly to `MediaRecorder` settings.\n *\n * @platform web\n */\nexport type RecordingOptionsWeb = {\n /** MIME type for the recording (for example, 'audio/webm', 'audio/mp4'). */\n mimeType?: string;\n /** Target bits per second for the recording. */\n bitsPerSecond?: number;\n};\n\n/**\n * Recording configuration options specific to iOS.\n *\n * iOS recording uses `AVAudioRecorder` with extensive format and quality options.\n * These settings provide fine-grained control over the recording characteristics.\n *\n * @platform ios\n */\nexport type RecordingOptionsIos = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`IOSOutputFormat`](#iosoutputformat) enum for all valid values.\n */\n outputFormat?: string | IOSOutputFormat | number;\n /**\n * The desired audio quality. See the [`AudioQuality`](#audioquality) enum for all valid values.\n */\n audioQuality: AudioQuality | number;\n /**\n * The desired bit rate strategy. See the next section for an enumeration of all valid values of `bitRateStrategy`.\n */\n bitRateStrategy?: number;\n /**\n * The desired bit depth hint.\n *\n * @example 16\n */\n bitDepthHint?: number;\n /**\n * The desired PCM bit depth.\n *\n * @example 16\n */\n linearPCMBitDepth?: number;\n /**\n * A boolean describing if the PCM data should be formatted in big endian.\n */\n linearPCMIsBigEndian?: boolean;\n /**\n * A boolean describing if the PCM data should be encoded in floating point or integral values.\n */\n linearPCMIsFloat?: boolean;\n};\n\n/**\n * Recording configuration options specific to Android.\n *\n * Android recording uses `MediaRecorder` with options for format, encoder, and file constraints.\n * These settings control the output format and quality characteristics.\n *\n * @platform android\n */\nexport type RecordingOptionsAndroid = {\n /**\n * The desired file extension.\n *\n * @example .caf\n */\n extension?: string;\n /**\n * The desired sample rate.\n *\n * @example 44100\n */\n sampleRate?: number;\n /**\n * The desired file format. See the [`AndroidOutputFormat`](#androidoutputformat) enum for all valid values.\n */\n outputFormat: AndroidOutputFormat;\n /**\n * The desired audio encoder. See the [`AndroidAudioEncoder`](#androidaudioencoder) enum for all valid values.\n */\n audioEncoder: AndroidAudioEncoder;\n /**\n * The desired maximum file size in bytes, after which the recording will stop (but `stopAndUnloadAsync()` must still\n * be called after this point).\n *\n * @example\n * `65536`\n */\n maxFileSize?: number;\n};\n\nexport type AudioMode = {\n /**\n * Determines if audio playback is allowed when the device is in silent mode.\n *\n * @platform ios\n */\n playsInSilentMode: boolean;\n /**\n * Determines how the audio session interacts with other sessions.\n *\n * @platform ios\n */\n interruptionMode: InterruptionMode;\n /**\n * Determines how the audio session interacts with other sessions on Android.\n *\n * @platform android\n */\n interruptionModeAndroid: InterruptionModeAndroid;\n /**\n * Whether the audio session allows recording.\n *\n * @default false\n * @platform ios\n */\n allowsRecording: boolean;\n /**\n * Whether the audio session stays active when the app moves to the background.\n * @default false\n */\n shouldPlayInBackground: boolean;\n /**\n * Whether the audio should route through the earpiece.\n * @platform android\n */\n shouldRouteThroughEarpiece: boolean;\n};\n\n/**\n * Audio interruption behavior modes for iOS.\n *\n * Controls how your app's audio interacts with other apps' audio when interruptions occur.\n * This affects what happens when phone calls, notifications, or other apps play audio.\n *\n * @platform ios\n */\nexport type InterruptionMode = 'mixWithOthers' | 'doNotMix' | 'duckOthers';\n\n/**\n * Audio interruption behavior modes for Android.\n *\n * Controls how your app's audio interacts with other apps' audio on Android.\n * Note that Android doesn't support 'mixWithOthers' mode; audio focus is more strictly managed.\n *\n * @platform android\n */\nexport type InterruptionModeAndroid = 'doNotMix' | 'duckOthers';\n"]}
|
|
@@ -59,10 +59,55 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
59
59
|
duration: number;
|
|
60
60
|
/**
|
|
61
61
|
* The current volume of the audio.
|
|
62
|
+
*
|
|
63
|
+
* **Range:** `0.0` to `1.0`. For example, `0.0` is completely silent (0%), `0.5` is half volume (50%), and `1.0` is full volume (100%).
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
69
|
+
*
|
|
70
|
+
* export default function App() {
|
|
71
|
+
* const player = useAudioPlayer(source);
|
|
72
|
+
*
|
|
73
|
+
* // Mute the audio
|
|
74
|
+
* player.volume = 0.0;
|
|
75
|
+
*
|
|
76
|
+
* // Set volume to 50%
|
|
77
|
+
* player.volume = 0.5;
|
|
78
|
+
*
|
|
79
|
+
* // Set to full volume
|
|
80
|
+
* player.volume = 1.0;
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
62
83
|
*/
|
|
63
84
|
volume: number;
|
|
64
85
|
/**
|
|
65
|
-
* The current playback rate of the audio.
|
|
86
|
+
* The current playback rate of the audio. It accepts different values depending on the platform:
|
|
87
|
+
* - **Android**: `0.1` to `2.0`
|
|
88
|
+
* - **iOS**: `0.0` to `2.0`
|
|
89
|
+
* - **Web**: Follows browser implementation
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
94
|
+
*
|
|
95
|
+
* export default function App() {
|
|
96
|
+
* const player = useAudioPlayer(source);
|
|
97
|
+
*
|
|
98
|
+
* // Normal playback speed
|
|
99
|
+
* player.playbackRate = 1.0;
|
|
100
|
+
*
|
|
101
|
+
* // Slow motion (half speed)
|
|
102
|
+
* player.playbackRate = 0.5;
|
|
103
|
+
*
|
|
104
|
+
* // Fast playback (1.5x speed)
|
|
105
|
+
* player.playbackRate = 1.5;
|
|
106
|
+
*
|
|
107
|
+
* // Maximum speed on mobile
|
|
108
|
+
* player.playbackRate = 2.0;
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
66
111
|
*/
|
|
67
112
|
playbackRate: number;
|
|
68
113
|
/**
|
|
@@ -95,7 +140,8 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
95
140
|
seekTo(seconds: number, toleranceMillisBefore?: number, toleranceMillisAfter?: number): Promise<void>;
|
|
96
141
|
/**
|
|
97
142
|
* Sets the current playback rate of the audio.
|
|
98
|
-
*
|
|
143
|
+
*
|
|
144
|
+
* @param rate The playback rate of the audio. See [`playbackRate`](#playbackrate) property for detailed range information.
|
|
99
145
|
* @param pitchCorrectionQuality The quality of the pitch correction.
|
|
100
146
|
*/
|
|
101
147
|
setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioModule.types.d.ts","sour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":["../src/AudioModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule, PermissionResponse, SharedObject } from 'expo-modules-core';\n\nimport {\n AudioMode,\n AudioSource,\n AudioStatus,\n PitchCorrectionQuality,\n RecorderState,\n RecordingInput,\n RecordingOptions,\n RecordingStartOptions,\n RecordingStatus,\n} from './Audio.types';\n\n/**\n * @hidden\n */\nexport declare class NativeAudioModule extends NativeModule {\n setIsAudioActiveAsync(active: boolean): Promise<void>;\n setAudioModeAsync(category: Partial<AudioMode>): Promise<void>;\n requestRecordingPermissionsAsync(): Promise<PermissionResponse>;\n getRecordingPermissionsAsync(): Promise<PermissionResponse>;\n\n readonly AudioPlayer: typeof AudioPlayer;\n readonly AudioRecorder: typeof AudioRecorder;\n}\n\nexport declare class AudioPlayer extends SharedObject<AudioEvents> {\n /**\n * Initializes a new audio player instance with the given source.\n * @hidden\n */\n constructor(source: AudioSource, updateInterval: number, keepAudioSessionActive: boolean);\n\n /**\n * Unique identifier for the player object.\n */\n id: number;\n\n /**\n * Boolean value indicating whether the player is currently playing.\n */\n playing: boolean;\n\n /**\n * Boolean value indicating whether the player is currently muted.\n */\n muted: boolean;\n\n /**\n * Boolean value indicating whether the player is currently looping.\n */\n loop: boolean;\n\n /**\n * Boolean value indicating whether the player is currently paused.\n */\n paused: boolean;\n\n /**\n * Boolean value indicating whether the player is finished loading.\n */\n isLoaded: boolean;\n\n /**\n * Boolean value indicating whether audio sampling is supported on the platform.\n */\n isAudioSamplingSupported: boolean;\n\n /**\n * Boolean value indicating whether the player is buffering.\n */\n isBuffering: boolean;\n\n /**\n * The current position through the audio item in seconds.\n */\n currentTime: number;\n\n /**\n * The total duration of the audio in seconds.\n */\n duration: number;\n\n /**\n * The current volume of the audio.\n */\n volume: number;\n\n /**\n * The current playback rate of the audio
|
|
1
|
+
{"version":3,"file":"AudioModule.types.js","sourceRoot":"","sources":["../src/AudioModule.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule, PermissionResponse, SharedObject } from 'expo-modules-core';\n\nimport {\n AudioMode,\n AudioSource,\n AudioStatus,\n PitchCorrectionQuality,\n RecorderState,\n RecordingInput,\n RecordingOptions,\n RecordingStartOptions,\n RecordingStatus,\n} from './Audio.types';\n\n/**\n * @hidden\n */\nexport declare class NativeAudioModule extends NativeModule {\n setIsAudioActiveAsync(active: boolean): Promise<void>;\n setAudioModeAsync(category: Partial<AudioMode>): Promise<void>;\n requestRecordingPermissionsAsync(): Promise<PermissionResponse>;\n getRecordingPermissionsAsync(): Promise<PermissionResponse>;\n\n readonly AudioPlayer: typeof AudioPlayer;\n readonly AudioRecorder: typeof AudioRecorder;\n}\n\nexport declare class AudioPlayer extends SharedObject<AudioEvents> {\n /**\n * Initializes a new audio player instance with the given source.\n * @hidden\n */\n constructor(source: AudioSource, updateInterval: number, keepAudioSessionActive: boolean);\n\n /**\n * Unique identifier for the player object.\n */\n id: number;\n\n /**\n * Boolean value indicating whether the player is currently playing.\n */\n playing: boolean;\n\n /**\n * Boolean value indicating whether the player is currently muted.\n */\n muted: boolean;\n\n /**\n * Boolean value indicating whether the player is currently looping.\n */\n loop: boolean;\n\n /**\n * Boolean value indicating whether the player is currently paused.\n */\n paused: boolean;\n\n /**\n * Boolean value indicating whether the player is finished loading.\n */\n isLoaded: boolean;\n\n /**\n * Boolean value indicating whether audio sampling is supported on the platform.\n */\n isAudioSamplingSupported: boolean;\n\n /**\n * Boolean value indicating whether the player is buffering.\n */\n isBuffering: boolean;\n\n /**\n * The current position through the audio item in seconds.\n */\n currentTime: number;\n\n /**\n * The total duration of the audio in seconds.\n */\n duration: number;\n\n /**\n * The current volume of the audio.\n *\n * **Range:** `0.0` to `1.0`. For example, `0.0` is completely silent (0%), `0.5` is half volume (50%), and `1.0` is full volume (100%).\n *\n *\n * @example\n * ```tsx\n * import { useAudioPlayer } from 'expo-audio';\n *\n * export default function App() {\n * const player = useAudioPlayer(source);\n *\n * // Mute the audio\n * player.volume = 0.0;\n *\n * // Set volume to 50%\n * player.volume = 0.5;\n *\n * // Set to full volume\n * player.volume = 1.0;\n * }\n * ```\n */\n volume: number;\n\n /**\n * The current playback rate of the audio. It accepts different values depending on the platform:\n * - **Android**: `0.1` to `2.0`\n * - **iOS**: `0.0` to `2.0`\n * - **Web**: Follows browser implementation\n *\n * @example\n * ```tsx\n * import { useAudioPlayer } from 'expo-audio';\n *\n * export default function App() {\n * const player = useAudioPlayer(source);\n *\n * // Normal playback speed\n * player.playbackRate = 1.0;\n *\n * // Slow motion (half speed)\n * player.playbackRate = 0.5;\n *\n * // Fast playback (1.5x speed)\n * player.playbackRate = 1.5;\n *\n * // Maximum speed on mobile\n * player.playbackRate = 2.0;\n * }\n * ```\n */\n playbackRate: number;\n\n /**\n * A boolean describing if we are correcting the pitch for a changed rate.\n */\n shouldCorrectPitch: boolean;\n\n /**\n * The current status of the audio player.\n * @hidden\n */\n currentStatus: AudioStatus;\n\n /**\n * Start playing audio.\n */\n play(): void;\n\n /**\n * Pauses the player.\n */\n pause(): void;\n\n /**\n * Replaces the current audio source with a new one.\n */\n replace(source: AudioSource): void;\n\n /**\n * Seeks the playback by the given number of seconds.\n * @param seconds The number of seconds to seek by.\n * @param toleranceMillisBefore The tolerance allowed before the requested seek time, in milliseconds. iOS only.\n * @param toleranceMillisAfter The tolerance allowed after the requested seek time, in milliseconds. iOS only.\n */\n seekTo(\n seconds: number,\n toleranceMillisBefore?: number,\n toleranceMillisAfter?: number\n ): Promise<void>;\n\n /**\n * Sets the current playback rate of the audio.\n *\n * @param rate The playback rate of the audio. See [`playbackRate`](#playbackrate) property for detailed range information.\n * @param pitchCorrectionQuality The quality of the pitch correction.\n */\n setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;\n\n /**\n *\n * @hidden\n */\n setAudioSamplingEnabled(enabled: boolean): void;\n\n /**\n * Remove the player from memory to free up resources.\n */\n remove(): void;\n}\n\n/**\n * Represents a single audio sample containing waveform data from all audio channels.\n *\n * Audio samples are provided in real-time when audio sampling is enabled on an `AudioPlayer`.\n * Each sample contains the raw PCM audio data for all channels (mono has 1 channel, stereo has 2).\n * This data can be used for audio visualization, analysis, or processing.\n */\nexport type AudioSample = {\n /** Array of audio channels, each containing PCM frame data. Stereo audio will have 2 channels (left/right). */\n channels: AudioSampleChannel[];\n /** Timestamp of this sample relative to the audio track's timeline, in seconds. */\n timestamp: number;\n};\n\n/**\n * Represents audio data for a single channel (for example, left or right in stereo audio).\n *\n * Contains the raw PCM (Pulse Code Modulation) audio frames for this channel.\n * Frame values are normalized between -1.0 and 1.0, where 0 represents silence.\n */\nexport type AudioSampleChannel = {\n /** Array of PCM audio frame values, each between -1.0 and 1.0. */\n frames: number[];\n};\n\n/**\n * Event types that an `AudioPlayer` can emit.\n *\n * These events allow you to listen for changes in playback state and receive real-time audio data.\n * Use `player.addListener()` to subscribe to these events.\n */\nexport type AudioEvents = {\n /** Fired when the player's status changes (play/pause/seek/load and so on.). */\n playbackStatusUpdate(status: AudioStatus): void;\n /** Fired when audio sampling is enabled and new sample data is available. */\n audioSampleUpdate(data: AudioSample): void;\n};\n\nexport declare class AudioRecorder extends SharedObject<RecordingEvents> {\n /**\n * Initializes a new audio recorder instance with the given source.\n * @hidden\n */\n constructor(options: Partial<RecordingOptions>);\n\n /**\n * Unique identifier for the recorder object.\n */\n id: number;\n\n /**\n * The current length of the recording, in seconds.\n */\n currentTime: number;\n\n /**\n * Boolean value indicating whether the recording is in progress.\n */\n isRecording: boolean;\n\n /**\n * The uri of the recording.\n */\n uri: string | null;\n\n /**\n * Starts the recording.\n * @param options Optional recording configuration options.\n */\n record(options?: RecordingStartOptions): void;\n\n /**\n * Stop the recording.\n */\n stop(): Promise<void>;\n\n /**\n * Pause the recording.\n */\n pause(): void;\n\n /**\n * Returns a list of available recording inputs. This method can only be called if the `Recording` has been prepared.\n * @return A `Promise` that is fulfilled with an array of `RecordingInput` objects.\n */\n getAvailableInputs(): RecordingInput[];\n\n /**\n * Returns the currently-selected recording input. This method can only be called if the `Recording` has been prepared.\n * @return A `Promise` that is fulfilled with a `RecordingInput` object.\n */\n getCurrentInput(): Promise<RecordingInput>;\n\n /**\n * Sets the current recording input.\n * @param inputUid The uid of a `RecordingInput`.\n * @return A `Promise` that is resolved if successful or rejected if not.\n */\n setInput(inputUid: string): void;\n\n /**\n * Status of the current recording.\n */\n getStatus(): RecorderState;\n\n /**\n * Starts the recording at the given time.\n * @param seconds The time in seconds to start recording at.\n * @deprecated Use `record({ atTime: seconds })` instead.\n */\n startRecordingAtTime(seconds: number): void;\n\n /**\n * Prepares the recording for recording.\n */\n prepareToRecordAsync(options?: Partial<RecordingOptions>): Promise<void>;\n\n /**\n * Stops the recording once the specified time has elapsed.\n * @param seconds The time in seconds to stop recording at.\n * @deprecated Use `record({ forDuration: seconds })` instead.\n */\n recordForDuration(seconds: number): void;\n}\n\n/**\n * Event types that an `AudioRecorder` can emit.\n *\n * These events are used internally by `expo-audio` hooks to provide real-time status updates.\n * Use `useAudioRecorderState()` or the `statusListener` parameter in `useAudioRecorder()` instead of subscribing directly.\n */\nexport type RecordingEvents = {\n /** Fired when the recorder's status changes (start/stop/pause/error, and so on). */\n recordingStatusUpdate: (status: RecordingStatus) => void;\n};\n"]}
|
package/expo-module.config.json
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
951d0b0ab79c3bba431b57e0af76cea5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
15014607ba0e2c9c0b3f773b322c01fa17a9b845
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c3a9d700335b8b14a6e99070f34912d9198cea731fb77303d63f6ace018a667c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0fabd183589936e20408ea363bdb6e204b08e745abb717c7163d253874a206c12bfa3709509565578e653021434a388b4de3f146f6d346a789fe3078c78dd882
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.audio",
|
|
5
5
|
"module": "expo.modules.audio",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.10",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.audio-1.0.
|
|
28
|
-
"url": "expo.modules.audio-1.0.
|
|
27
|
+
"name": "expo.modules.audio-1.0.10.aar",
|
|
28
|
+
"url": "expo.modules.audio-1.0.10.aar",
|
|
29
29
|
"size": 210085,
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
30
|
+
"sha512": "0fabd183589936e20408ea363bdb6e204b08e745abb717c7163d253874a206c12bfa3709509565578e653021434a388b4de3f146f6d346a789fe3078c78dd882",
|
|
31
|
+
"sha256": "c3a9d700335b8b14a6e99070f34912d9198cea731fb77303d63f6ace018a667c",
|
|
32
|
+
"sha1": "15014607ba0e2c9c0b3f773b322c01fa17a9b845",
|
|
33
|
+
"md5": "951d0b0ab79c3bba431b57e0af76cea5"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -61,47 +61,47 @@
|
|
|
61
61
|
"group": "androidx.media3",
|
|
62
62
|
"module": "media3-exoplayer",
|
|
63
63
|
"version": {
|
|
64
|
-
"requires": "1.
|
|
64
|
+
"requires": "1.8.0"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"group": "androidx.media3",
|
|
69
69
|
"module": "media3-exoplayer-dash",
|
|
70
70
|
"version": {
|
|
71
|
-
"requires": "1.
|
|
71
|
+
"requires": "1.8.0"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"group": "androidx.media3",
|
|
76
76
|
"module": "media3-datasource-okhttp",
|
|
77
77
|
"version": {
|
|
78
|
-
"requires": "1.
|
|
78
|
+
"requires": "1.8.0"
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
"group": "androidx.media3",
|
|
83
83
|
"module": "media3-exoplayer-hls",
|
|
84
84
|
"version": {
|
|
85
|
-
"requires": "1.
|
|
85
|
+
"requires": "1.8.0"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"group": "androidx.media3",
|
|
90
90
|
"module": "media3-exoplayer-smoothstreaming",
|
|
91
91
|
"version": {
|
|
92
|
-
"requires": "1.
|
|
92
|
+
"requires": "1.8.0"
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
96
|
"files": [
|
|
97
97
|
{
|
|
98
|
-
"name": "expo.modules.audio-1.0.
|
|
99
|
-
"url": "expo.modules.audio-1.0.
|
|
98
|
+
"name": "expo.modules.audio-1.0.10.aar",
|
|
99
|
+
"url": "expo.modules.audio-1.0.10.aar",
|
|
100
100
|
"size": 210085,
|
|
101
|
-
"sha512": "
|
|
102
|
-
"sha256": "
|
|
103
|
-
"sha1": "
|
|
104
|
-
"md5": "
|
|
101
|
+
"sha512": "0fabd183589936e20408ea363bdb6e204b08e745abb717c7163d253874a206c12bfa3709509565578e653021434a388b4de3f146f6d346a789fe3078c78dd882",
|
|
102
|
+
"sha256": "c3a9d700335b8b14a6e99070f34912d9198cea731fb77303d63f6ace018a667c",
|
|
103
|
+
"sha1": "15014607ba0e2c9c0b3f773b322c01fa17a9b845",
|
|
104
|
+
"md5": "951d0b0ab79c3bba431b57e0af76cea5"
|
|
105
105
|
}
|
|
106
106
|
]
|
|
107
107
|
},
|
|
@@ -115,8 +115,8 @@
|
|
|
115
115
|
},
|
|
116
116
|
"files": [
|
|
117
117
|
{
|
|
118
|
-
"name": "expo.modules.audio-1.0.
|
|
119
|
-
"url": "expo.modules.audio-1.0.
|
|
118
|
+
"name": "expo.modules.audio-1.0.10-sources.jar",
|
|
119
|
+
"url": "expo.modules.audio-1.0.10-sources.jar",
|
|
120
120
|
"size": 13104,
|
|
121
121
|
"sha512": "071848199cd4a94d3ba77e7d173daa7888e1f87f9c3a0c8e260bc3dffdd91b785511c8bad75eeeb2e7d91a5f1a590b3ed12afe49cbe7792761d65c450ac91ba7",
|
|
122
122
|
"sha256": "caf8ac9e00d60620ad5406dea94ae3865cc7b9aca65ade0a4239b84048adf494",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ce4ff3170ad073f66a1bb75f0f990d62
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d7a9e3bb705288e67f8cc79bd4cffb25084f6cef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2bddea477327cfed5d758fe034dab5a13ddb4a8796961aceeeeb00c478e1a61d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0fe519e39af9a59a990a2b20e417bccb31a00e6667780cbcb1b4b44ea291db7707772f88ce600698740bc4175a5e1af80f0816a978fe51e60bcbd635b0c0524b
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.audio</groupId>
|
|
11
11
|
<artifactId>expo.modules.audio</artifactId>
|
|
12
|
-
<version>1.0.
|
|
12
|
+
<version>1.0.10</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.audio</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -40,31 +40,31 @@
|
|
|
40
40
|
<dependency>
|
|
41
41
|
<groupId>androidx.media3</groupId>
|
|
42
42
|
<artifactId>media3-exoplayer</artifactId>
|
|
43
|
-
<version>1.
|
|
43
|
+
<version>1.8.0</version>
|
|
44
44
|
<scope>runtime</scope>
|
|
45
45
|
</dependency>
|
|
46
46
|
<dependency>
|
|
47
47
|
<groupId>androidx.media3</groupId>
|
|
48
48
|
<artifactId>media3-exoplayer-dash</artifactId>
|
|
49
|
-
<version>1.
|
|
49
|
+
<version>1.8.0</version>
|
|
50
50
|
<scope>runtime</scope>
|
|
51
51
|
</dependency>
|
|
52
52
|
<dependency>
|
|
53
53
|
<groupId>androidx.media3</groupId>
|
|
54
54
|
<artifactId>media3-datasource-okhttp</artifactId>
|
|
55
|
-
<version>1.
|
|
55
|
+
<version>1.8.0</version>
|
|
56
56
|
<scope>runtime</scope>
|
|
57
57
|
</dependency>
|
|
58
58
|
<dependency>
|
|
59
59
|
<groupId>androidx.media3</groupId>
|
|
60
60
|
<artifactId>media3-exoplayer-hls</artifactId>
|
|
61
|
-
<version>1.
|
|
61
|
+
<version>1.8.0</version>
|
|
62
62
|
<scope>runtime</scope>
|
|
63
63
|
</dependency>
|
|
64
64
|
<dependency>
|
|
65
65
|
<groupId>androidx.media3</groupId>
|
|
66
66
|
<artifactId>media3-exoplayer-smoothstreaming</artifactId>
|
|
67
|
-
<version>1.
|
|
67
|
+
<version>1.8.0</version>
|
|
68
68
|
<scope>runtime</scope>
|
|
69
69
|
</dependency>
|
|
70
70
|
</dependencies>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6d8e3b70b6d5d31a4aa7923481692075
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e12e94837cf4f610def23dd1cad57619130bcf7b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22cb1aeed898a563f0283e13cb3f4871d6b983c7438be609714997d4f603da4f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8dd13843e0d5752552a01caae9decf79edb684f9820bf0e96137f787966fd31e471efcaf480ffcf6c30e2561b1db1fa4265020f88bef4464c77568a5f1e1e4df
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.audio</groupId>
|
|
4
4
|
<artifactId>expo.modules.audio</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>1.0.
|
|
7
|
-
<release>1.0.
|
|
6
|
+
<latest>1.0.10</latest>
|
|
7
|
+
<release>1.0.10</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>1.0.
|
|
9
|
+
<version>1.0.10</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250908140920</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
b430347e6929079e3e35042c2df5d4b9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
68c54cf97389e519557612e4eb3a6cbaabe3ef63
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f114da4aaf33aeb9cbb34426ef9f7cd0764359702079bf97a5ce0ad945ceaae5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d2e964bbfc6b7d7d9a491bccc9f0720e74d46ce10fcb321e33375be8f63a051772608b4d3608aac45851d6e160c63b18ce249c7e3aa51d9254cad5069ab06a1a
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-audio",
|
|
3
3
|
"title": "Expo Audio",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.10",
|
|
5
5
|
"description": "A cross-platform audio library for React Native and Expo apps.",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react": "*",
|
|
41
41
|
"react-native": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "d087a2182086089f23bcee65e27434f21db50128"
|
|
44
44
|
}
|
package/src/Audio.types.ts
CHANGED
|
@@ -28,8 +28,27 @@ export type AudioSource =
|
|
|
28
28
|
*/
|
|
29
29
|
export type AudioPlayerOptions = {
|
|
30
30
|
/**
|
|
31
|
-
* How often (in milliseconds) to emit playback status updates.
|
|
32
|
-
*
|
|
31
|
+
* How often (in milliseconds) to emit playback status updates. Defaults to 500ms.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
36
|
+
*
|
|
37
|
+
* export default function App() {
|
|
38
|
+
* const player = useAudioPlayer(source);
|
|
39
|
+
*
|
|
40
|
+
* // High-frequency updates for smooth progress bars
|
|
41
|
+
* const player = useAudioPlayer(source, { updateInterval: 100 });
|
|
42
|
+
*
|
|
43
|
+
* // Standard updates (default behavior)
|
|
44
|
+
* const player = useAudioPlayer(source, { updateInterval: 500 });
|
|
45
|
+
*
|
|
46
|
+
* // Low-frequency updates for better performance
|
|
47
|
+
* const player = useAudioPlayer(source, { updateInterval: 1000 });
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @default 500ms
|
|
33
52
|
*
|
|
34
53
|
* @platform ios
|
|
35
54
|
* @platform android
|
package/src/AudioModule.types.ts
CHANGED
|
@@ -84,11 +84,56 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* The current volume of the audio.
|
|
87
|
+
*
|
|
88
|
+
* **Range:** `0.0` to `1.0`. For example, `0.0` is completely silent (0%), `0.5` is half volume (50%), and `1.0` is full volume (100%).
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```tsx
|
|
93
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
94
|
+
*
|
|
95
|
+
* export default function App() {
|
|
96
|
+
* const player = useAudioPlayer(source);
|
|
97
|
+
*
|
|
98
|
+
* // Mute the audio
|
|
99
|
+
* player.volume = 0.0;
|
|
100
|
+
*
|
|
101
|
+
* // Set volume to 50%
|
|
102
|
+
* player.volume = 0.5;
|
|
103
|
+
*
|
|
104
|
+
* // Set to full volume
|
|
105
|
+
* player.volume = 1.0;
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
87
108
|
*/
|
|
88
109
|
volume: number;
|
|
89
110
|
|
|
90
111
|
/**
|
|
91
|
-
* The current playback rate of the audio.
|
|
112
|
+
* The current playback rate of the audio. It accepts different values depending on the platform:
|
|
113
|
+
* - **Android**: `0.1` to `2.0`
|
|
114
|
+
* - **iOS**: `0.0` to `2.0`
|
|
115
|
+
* - **Web**: Follows browser implementation
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* import { useAudioPlayer } from 'expo-audio';
|
|
120
|
+
*
|
|
121
|
+
* export default function App() {
|
|
122
|
+
* const player = useAudioPlayer(source);
|
|
123
|
+
*
|
|
124
|
+
* // Normal playback speed
|
|
125
|
+
* player.playbackRate = 1.0;
|
|
126
|
+
*
|
|
127
|
+
* // Slow motion (half speed)
|
|
128
|
+
* player.playbackRate = 0.5;
|
|
129
|
+
*
|
|
130
|
+
* // Fast playback (1.5x speed)
|
|
131
|
+
* player.playbackRate = 1.5;
|
|
132
|
+
*
|
|
133
|
+
* // Maximum speed on mobile
|
|
134
|
+
* player.playbackRate = 2.0;
|
|
135
|
+
* }
|
|
136
|
+
* ```
|
|
92
137
|
*/
|
|
93
138
|
playbackRate: number;
|
|
94
139
|
|
|
@@ -132,7 +177,8 @@ export declare class AudioPlayer extends SharedObject<AudioEvents> {
|
|
|
132
177
|
|
|
133
178
|
/**
|
|
134
179
|
* Sets the current playback rate of the audio.
|
|
135
|
-
*
|
|
180
|
+
*
|
|
181
|
+
* @param rate The playback rate of the audio. See [`playbackRate`](#playbackrate) property for detailed range information.
|
|
136
182
|
* @param pitchCorrectionQuality The quality of the pitch correction.
|
|
137
183
|
*/
|
|
138
184
|
setPlaybackRate(rate: number, pitchCorrectionQuality?: PitchCorrectionQuality): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
206298fcd2c19a9bcf7106a4165a8941
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4d1a4e8b0f4c72e56a4bb3c6290ee78aedafaff3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
abb37dd839e29011c906ae2ee8486955e9b2a1eeeb38f474691ed35e7ccd5199
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5690f7de0ddfec039106d58b7386a71819c96c5210b89c2fc7b6ea2523b346b0cfd7ab7cc1dd91326f29268f9a5007c2a181e18d67588d97af2a0ef44d137cfd
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3a05dfe7337693894c40391bd462bde1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d9a355a0d351383cfcd815586cf5ee9caf6cd9c4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
131b5afd5aefb0c252703fe17da786922e18905a53a5c5f42e801d9388dac277
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8773c65dd0430478ed0781e23a10867c7bb479b180c7dcd98a1aff64b0828d42a75f1ec21e5347185497c3d6c111679ec4c6aa2f4b4f9358ce471d90c68ea1da
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c8736ee947bfc40e199285052f5372d2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e810fdb59e0fb9643183bbafbda645bca859e717
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b17677c5d6968b50ab61fc809e671a40e70367ee6bf31a03c19ee6966daa8f48
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
062cb7c15c08e7d02f9256b0e920220dce5e78b3255756bc60807bbe6888100196ef8e87bd7ef27610effbc9b6eed62246f64acf049b9ab46ee5cf77bc7ca99c
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|