Set type of rate and volume to number

This commit is contained in:
Jan Aagaard
2018-06-26 22:54:48 +02:00
parent 3626213488
commit 22291920e9
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -223,8 +223,8 @@ Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY;
Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY;
async () => {
const result = await Audio.Sound.create({uri: 'uri'}, {
volume: 0.5,
rate: 0.6
volume: 0.55,
rate: 16.5
}, null, true);
const sound = result.sound;
+4 -3
View File
@@ -554,10 +554,12 @@ export interface PlaybackStatusToSet {
isMuted?: boolean;
positionMillis?: number;
progressUpdateIntervalMillis?: number;
rate?: FloatFromZeroToOne;
/** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */
rate?: number;
shouldCorrectPitch?: boolean;
shouldPlay?: boolean;
volume?: FloatFromZeroToOne;
/** A number between `0.0` (silence) and `1.0` (maximum volume). */
volume?: number;
}
export type PlaybackSource = RequireSource | { uri: string } | Asset;
@@ -670,7 +672,6 @@ export class PlaybackObject {
setRateAsync(
/** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */
rate: number,
/** A boolean describing if we should correct the pitch for a changed rate. If set to `true`, the pitch of the audio will be corrected (so a rate different than `1.0` will timestretch the audio). */
shouldCorrectPitch: boolean
): Promise<PlaybackStatus>;