rochars / wavefile

Create, read and write wav files according to the specs. :star: :notes: :heart:
MIT License
226 stars 48 forks source link

Not a supported format error for 32f wav #3

Closed ismay closed 6 years ago

ismay commented 6 years ago

With the latest version I'm getting a Not a supported format. error when attempting to read a 32f, mono wav.

Build log here Code that's failing here Code for failing test here

I didn't see any tests for reading 32f wavs, is this currently supposed to be functional?

ismay commented 6 years ago

The wav file was generated with wavefile 5 with this script:

const fs = require('fs');
const path = require('path');
const { fromImage, toWav } = require('./lib');

const imagePath = path.join(__dirname, 'test', 'fixtures', 'image-to-float', 'input.png');
const imageBuffer = fs.readFileSync(imagePath);

fromImage(imageBuffer).then(floats => toWav(floats)).then(wavBuffer => {
  fs.writeFileSync(path.join(__dirname, 'input.wav'), wavBuffer)
});
ismay commented 6 years ago

My mistake, I forgot to call toBuffer(). Sorry!