File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,9 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
184184 soundRef . current = await NativeHandlers . Sound . initializeSound (
185185 { uri : item . file . uri } ,
186186 {
187+ pitchCorrectionQuality : 'high' ,
187188 progressUpdateIntervalMillis : 100 ,
189+ shouldCorrectPitch : true ,
188190 } ,
189191 onPlaybackStatusUpdate ,
190192 ) ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export const useAudioPlayer = (props: UseSoundPlayerProps) => {
7171 return ;
7272 }
7373 if ( soundRef . current ?. setRateAsync ) {
74- await soundRef . current . setRateAsync ( speed ) ;
74+ await soundRef . current . setRateAsync ( speed , true , 'high' ) ;
7575 }
7676 } ,
7777 [ isExpoCLI , soundRef ] ,
Original file line number Diff line number Diff line change @@ -107,9 +107,12 @@ export type PlaybackStatus = {
107107 shouldPlay : boolean ;
108108} ;
109109
110+ export type PitchCorrectionQuality = 'low' | 'medium' | 'high' ;
111+
110112export type AVPlaybackStatusToSet = {
111113 isLooping : boolean ;
112114 isMuted : boolean ;
115+ pitchCorrectionQuality : PitchCorrectionQuality ;
113116 positionMillis : number ;
114117 progressUpdateIntervalMillis : number ;
115118 rate : number ;
@@ -152,7 +155,11 @@ export type SoundReturnType = {
152155 seek ?: ( progress : number , tolerance ?: number ) => void ;
153156 setPositionAsync ?: ( millis : number ) => void ;
154157 setProgressUpdateIntervalAsync ?: ( progressUpdateIntervalMillis : number ) => void ;
155- setRateAsync ?: ( rate : number ) => void ;
158+ setRateAsync ?: (
159+ rate : number ,
160+ shouldCorrectPitch : boolean ,
161+ pitchCorrectionQuality ?: PitchCorrectionQuality ,
162+ ) => void ;
156163 soundRef ?: React . RefObject < SoundReturnType > ;
157164 stopAsync ?: ( ) => void ;
158165 style ?: StyleProp < ViewStyle > ;
You can’t perform that action at this time.
0 commit comments