fix(core): correctly encode waveform
This commit is contained in:
parent
03fd249cd4
commit
f36ad72f1a
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ export function decodeWaveform(wf: Uint8Array): number[] {
|
||||||
*/
|
*/
|
||||||
export function encodeWaveform(wf: number[]): Uint8Array {
|
export function encodeWaveform(wf: number[]): Uint8Array {
|
||||||
const bitsCount = wf.length * 5
|
const bitsCount = wf.length * 5
|
||||||
const bytesCount = ~~(bitsCount + 7) / 8
|
const bytesCount = ~~((bitsCount + 7) / 8)
|
||||||
const result = new Uint8Array(bytesCount + 1)
|
const result = new Uint8Array(bytesCount + 1)
|
||||||
const dv = dataViewFromBuffer(result)
|
const dv = dataViewFromBuffer(result)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue