0.1.0 • Published 8 years ago
toepler v0.1.0
toepler
convert images to audio and vice versa
API
toWav(image, options)
Returns a Promise<Buffer> for a 24-bit, mono .wav file.
image: Type:Buffer. Expects theBufferto be a.jpgimage by default (can be changed by settingoptions.inputType).options: Type:ObjectinputType: Type:string. Default:'image/jpeg'. MIME type of the input image buffer. Only'image/png'and'image/jpeg'are supported. Any.pngtransparency information will be discarded.sampleRate: Type:number. Default:44100. The sample rate of the output.wav.
toImage(sound, options)
Returns a Promise<Buffer> for a 24-bit .jpg file.
sound: Type:Buffer. Expects aBufferof a 24-bit, mono.wavfile.options: Type:Objectwidth: Type:number. Minimum:1. The width of the image to output. If there are not enough samples to fill the image, the remaining pixels will be left black. If there are too many samples, the excess samples will be discarded. Missing dimensions will be extrapolated from the available samples and dimensions.height: see width.- outputType: Type:
string. Default:'jpg'. The type of image to output. Can be'png'or'jpg'
License
0.1.0
8 years ago