0.1.1 • Published 2 years ago

react-audio-waveform-nextjs v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-audio-waveform

Render waveforms from arrays of peak data generated by Audio Waveform quickly and easily.

Installation

npm install react-audio-waveform --save

or

yarn add react-audio-waveform

Usage

import Waveform from "react-audio-waveform"

// ...

<Waveform
  barWidth={4}
  peaks={this.props.peaks}
  height={200}
  pos={this.props.pos}
  duration={210}
  onClick={this.handleClick}
  color="#676767"
  progressGradientColors={[[0, "#888"], [1, "#aaa"]]}
  transitionDuration={300}
/>

Options

ParameterDescriptionPermitted ValuesDefault
barWidthWidth of the peaksNumberundefined
colorThe main waveform's colorString (hex value)undefined
durationAudio length in secondsNumberundefined
gradientColorsThe main waveform's color as an array of arrays containing start positions (from 0 to 1) and colors; example: [[0, "#888888"], [1, "#aaaaaa"]]Arrayundefined
heightThe waveform's heightIntegerundefined
onClickHandler for seeking. This is a function with a single argument of seconds as a number.function() => {}
peaksArray of peaks.Arrayundefined
pixelRatioDetermines how many pixels to fit inside a single pixel space.NumberThe current device's pixel ratio
posThe audio's current position in secondsNumberundefined
progressColorThe progress waveform's colorString (hex value)undefined
progressGradientColorsThe progress waveform's color as an array of arrays containing start positions (from 0 to 1) and colors; example: [[0, "#888888"], [1, "#aaaaaa"]]Arrayundefined
transitionDurationLength in milliseconds of the waveform animation transitionNumber200
0.1.1

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago