@@ -86,14 +86,14 @@ import { Waveform, type IWaveformRef } from 'react-native-audio-waveform';
8686const path = ' ' ; // path to the audio file for which you want to show waveform
8787const ref = useRef <IWaveformRef >(null );
8888<Waveform
89- mode = " static"
90- ref = { ref }
91- path = { item }
92- candleSpace = { 2 }
93- candleWidth = { 4 }
94- scrubColor = " white"
95- onPlayerStateChange = { playerState => console .log (playerState )}
96- onPanStateChange = { isMoving => console .log (isMoving )}
89+ mode = " static"
90+ ref = { ref }
91+ path = { item }
92+ candleSpace = { 2 }
93+ candleWidth = { 4 }
94+ scrubColor = " white"
95+ onPlayerStateChange = { playerState => console .log (playerState )}
96+ onPanStateChange = { isMoving => console .log (isMoving )}
9797/>;
9898```
9999
@@ -108,12 +108,12 @@ import { Waveform, type IWaveformRef } from 'react-native-audio-waveform';
108108
109109const ref = useRef <IWaveformRef >(null );
110110<Waveform
111- mode = " live"
112- ref = { ref }
113- candleSpace = { 2 }
114- candleWidth = { 4 }
115- onRecorderStateChange = { recorderState => console .log (recorderState )}
116- />;
111+ mode = " live"
112+ ref = { ref }
113+ candleSpace = { 2 }
114+ candleWidth = { 4 }
115+ onRecorderStateChange = { recorderState => console .log (recorderState )}
116+ />
117117```
118118
119119You can check out the full example at [ Example] ( ./example/src/App.tsx ) .
@@ -140,15 +140,15 @@ You can check out the full example at [Example](./example/src/App.tsx).
140140
141141---
142142
143- #### IWaveformRef methods
143+ #### IWaveformRef Methods
144144
145145#### For Static mode
146146
147147#### startPlayer()
148148
149149``` ts
150150startPlayer ({
151- finishMode?: FinishMode ;
151+ finishMode?: FinishMode ;
152152}): Promise < boolean >
153153```
154154
@@ -186,13 +186,13 @@ It returns a boolean indicating whether playback is resumed again.
186186
187187``` ts
188188startRecord ({
189- encoder:number ;
190- sampleRate : number ;
191- bitRate : number ;
192- fileNameFormat : string ;
193- useLegacy : boolean ;
194- updateFrequency ?: UpdateFrequency ;
195- }): Promise < boolean > ;
189+ encoder:number ;
190+ sampleRate : number ;
191+ bitRate : number ;
192+ fileNameFormat : string ;
193+ useLegacy : boolean ;
194+ updateFrequency ?: UpdateFrequency ;
195+ }): Promise < boolean >
196196```
197197
198198Start a new audio recording with the given parameters. It will return whether the recording was started or not.
@@ -248,17 +248,17 @@ By combining this with checkHasAudioRecorderPermission you can ask for permissio
248248Check out the following example:
249249
250250``` ts
251- let hasPermission: PermissionStatus = await checkHasAudioRecorderPermission ();
251+ let hasPermission = await checkHasAudioRecorderPermission ();
252252
253253if (hasPermission === PermissionStatus .granted ) {
254- startRecording ();
254+ startRecording ();
255255} else if (hasPermission === PermissionStatus .undetermined ) {
256- constpermissionStatus = awaitgetAudioRecorderPermission ();
257- if (permissionStatus === PermissionStatus .granted ) {
258- startRecording ();
259- }
256+ const permissionStatus = await getAudioRecorderPermission ();
257+ if (permissionStatus === PermissionStatus .granted ) {
258+ startRecording ();
259+ }
260260} else {
261- Linking .openSettings ();
261+ Linking .openSettings ();
262262}
263263```
264264
@@ -268,19 +268,19 @@ Linking.openSettings();
268268
269269``` ts
270270enum PlayerState {
271- playing = ' playing' ,
272- paused = ' paused' ,
273- stopped = ' stopped' ,
271+ playing = ' playing' ,
272+ paused = ' paused' ,
273+ stopped = ' stopped' ,
274274}
275275```
276276
277277#### RecorderState
278278
279279``` ts
280280enum RecorderState {
281- recording = ' recording' ,
282- paused = ' paused' ,
283- stopped = ' stopped' ,
281+ recording = ' recording' ,
282+ paused = ' paused' ,
283+ stopped = ' stopped' ,
284284}
285285```
286286
@@ -289,19 +289,19 @@ stopped = 'stopped',
289289``` ts
290290// Update frequency in milliseconds
291291enum UpdateFrequency {
292- high = 250.0 ,
293- medium = 500.0 ,
294- low = 1000.0 ,
292+ high = 250.0 ,
293+ medium = 500.0 ,
294+ low = 1000.0 ,
295295}
296296```
297297
298298#### PermissionStatus
299299
300300``` ts
301301enum PermissionStatus {
302- denied = ' denied' ,
303- undetermined = ' undetermined' ,
304- granted = ' granted' ,
302+ denied = ' denied' ,
303+ undetermined = ' undetermined' ,
304+ granted = ' granted' ,
305305}
306306```
307307
0 commit comments