8000 add range draw for react example · chrisweb/waveform-visualizer@d258aa4 · GitHub
[go: up one dir, main page]

Skip to content

Commit d258aa4

Browse files
committed
add range draw for react example
1 parent 2ea53cb commit d258aa4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,19 @@ const WaveformComponent = () => {
186186
}, [])
187187

188188
// here is some pseudo code to show you what to when another sound (song) gets played
189+
// we replace the wave data (peaks) of the previous song with the data for the current song
189190
//playerRef.current.onPlayCallback((sound) => {
190191
// const peaksArray = sound.waveData
191192
// waveformRef.current.setWaveData(peaksArray)
192193
//})
193194

195+
// and here is some pseudo code to show you have to change the range display
196+
// when your player is playing a sound (song)
197+
// the range value is the playing progress in percent, so a value between 0 and 100
198+
//playerRef.current.onPlayingCallback((progressInPercent) => {
199+
// waveformRef.current.draw(progressInPercent)
200+
//})
201+
194202
const initializeWaveform = useCallback(() => {
195203

196204
const waveLayoutOptions: IWaveLayoutOptions = {

0 commit comments

Comments
 (0)
0