Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

Valid mp3 file returns format "unknown" #64

Open
FireController1847 opened this issue Jan 31, 2018 · 2 comments
Open

Valid mp3 file returns format "unknown" #64

FireController1847 opened this issue Jan 31, 2018 · 2 comments

Comments

@FireController1847
Copy link

Here's my attempt at this.

const wae = require("web-audio-engine");
const mp3decoder = require("lame");
const { promisify } = require("util");
const Decode = promisify(mp3decoder.Decoder);

wae.decoder.set("mp3", Decode);
wae.decoder.set("m4a", Decode);

const fs = require("fs");
const AudioContext = require("web-audio-engine").RenderingAudioContext;
const context = new AudioContext();
const audioData = fs.readFileSync("c7.wav.mp3");

context.decodeAudioData(audioData).then((audioBuffer) => {
  console.log(audioBuffer);
});

You can downloaded said file here. http://www.multiplayerpiano.com/mp3/c7.wav.mp3
Why is this CONSTANTLY returning format unknown?

@FireController1847
Copy link
Author

This is still an issue, the reasoning behind why I closed it is a seperate issue entirely.

@mreinstein
Copy link

I'm having the same problem. Can someone explain how to use other decoders besides the built-in wav support?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants