Skip to content
Open
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
5 changes: 3 additions & 2 deletions package/expo-package/src/optionalDependencies/Sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class ExpoAudioSoundAdapter {

// eslint-disable-next-line require-await
loadAsync = async (initialStatus) => {
// We have to subscribe as early as possible so that we know the initial status(durarion, etc.) of the audio.
this.subscribeStatusEventListener();
this.initialShouldCorrectPitch = initialStatus.shouldCorrectPitch;
this.initialPitchCorrectionQuality = initialStatus.pitchCorrectionQuality;
};
Expand Down Expand Up @@ -136,8 +138,7 @@ class ExpoAudioSoundAdapter {
};

// eslint-disable-next-line require-await
setPositionAsync: SoundReturnType['setPositionAsync'] = async (milliseconds) => {
const seconds = milliseconds / 1000;
setPositionAsync: SoundReturnType['setPositionAsync'] = async (seconds) => {
this.player.seekTo(seconds);
};

Expand Down
3 changes: 3 additions & 0 deletions package/native-package/src/optionalDependencies/Audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ class _Audio {
resumePlayer = async () => {
await audioRecorderPlayer.resumePlayer();
};
seekToPlayer = async (positionInMillis: number) => {
await audioRecorderPlayer.seekToPlayer(positionInMillis);
};
startPlayer = async (uri, _, onPlaybackStatusUpdate) => {
try {
const playback = await audioRecorderPlayer.startPlayer(uri);
Expand Down
Loading
Loading