Fluent Audiowaveform is a Node.js wrapper around [audiowaveform](https://github.com/bbc/audiowaveform).
npm install fluent-audiowaveformsh
yarn add fluent-audiowaveform
`Usage
>Install audiowaveform before using fluent-audiowaveform.
$3
`typescript
import audiowaveform from 'fluent-audiowaveform';
`$3
input(stream: Readable)
`typescript
// Pass the stream containing input file
audiowaveform().input(stream)
`
toPng(options: {\
width?: number;\
height?: number;\
colors?: "audacity" | "audition";\
borderColor?: string;\
backgroundColor?: string;\
waveformColor?: string;\
axisLabelColor?: string;\
})
`typescript
// Return a png image
audiowaveform().input(stream).toPng({
width: 1200,
height: 200,
axisLabel: "ffffff",
backgroundColor: "000000"
})
`
toJSON()
`typescript
// Return a JSON object
audiowaveform().input(stream).toJSON()
`
start(seconds: number)
`typescript
// Start at 53 seconds
audiowaveform().input(stream).toPng().start(53).pipe(res)
`
end(seconds: number)
`typescript
// End at 745 seconds
audiowaveform().input(stream).toPng().start(53).end(745).pipe(res)
`
bits(8 | 16: number)
`typescript
// 8 data bits
audiowaveform().input(stream).toJSON().bits(8).pipe(res)
`
splitChannels()
`typescript
// Split channels instead of a single waveform
audiowaveform().input(stream).toJSON().splitChannels().pipe(res)
`
pixelsPerSecond(zoom: number)
`typescript
// 50 pixels for second
audiowaveform().input(stream).toPNG().pixelsPerSecond(50).pipe(res)
`
pipe(stream: Writable)
`typescript
// Pass the output stream, usually the res object
audiowaveform().input(stream).toJSON().pipe(res)
`
promise()
`typescript
// Turn all methods into a promise
const jsonObject = await audiowaveform().input(stream).toJSON().promise()
``