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) => {
184
184
soundRef . current = await NativeHandlers . Sound . initializeSound (
185
185
{ uri : item . file . uri } ,
186
186
{
187
+ pitchCorrectionQuality : 'high' ,
187
188
progressUpdateIntervalMillis : 100 ,
189
+ shouldCorrectPitch : true ,
188
190
} ,
189
191
onPlaybackStatusUpdate ,
190
192
) ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export const useAudioPlayer = (props: UseSoundPlayerProps) => {
71
71
return ;
72
72
}
73
73
if ( soundRef . current ?. setRateAsync ) {
74
- await soundRef . current . setRateAsync ( speed ) ;
74
+ await soundRef . current . setRateAsync ( speed , true , 'high' ) ;
75
75
}
76
76
} ,
77
77
[ isExpoCLI , soundRef ] ,
Original file line number Diff line number Diff line change @@ -107,9 +107,12 @@ export type PlaybackStatus = {
107
107
shouldPlay : boolean ;
108
108
} ;
109
109
110
+ export type PitchCorrectionQuality = 'low' | 'medium' | 'high' ;
111
+
110
112
export type AVPlaybackStatusToSet = {
111
113
isLooping : boolean ;
112
114
isMuted : boolean ;
115
+ pitchCorrectionQuality : PitchCorrectionQuality ;
113
116
positionMillis : number ;
114
117
progressUpdateIntervalMillis : number ;
115
118
rate : number ;
@@ -152,7 +155,11 @@ export type SoundReturnType = {
152
155
seek ?: ( progress : number , tolerance ?: number ) => void ;
153
156
setPositionAsync ?: ( millis : number ) => void ;
154
157
setProgressUpdateIntervalAsync ?: ( progressUpdateIntervalMillis : number ) => void ;
155
- setRateAsync ?: ( rate : number ) => void ;
158
+ setRateAsync ?: (
159
+ rate : number ,
160
+ shouldCorrectPitch : boolean ,
161
+ pitchCorrectionQuality ?: PitchCorrectionQuality ,
162
+ ) => void ;
156
163
soundRef ?: React . RefObject < SoundReturnType > ;
157
164
stopAsync ?: ( ) => void ;
158
165
style ?: StyleProp < ViewStyle > ;
You can’t perform that action at this time.
0 commit comments