-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noise #91
Comments
It seems like you are trying to encode mp3 data, treated as raw PCM data, into another mp3. Did you mean to use |
Noup, using |
You are piping the content of the file "music.mp3" as input to the Encoder. The Encoder takes raw PCM data and turns it into MP3 data. Thus it will treat whatever bytes are in "music.mp3" as raw PCM data, which will be heard as noise. |
me too, i used the following code:
where tmpRaw is the path to the default mp3 and pipeOut is the path for the output. I can't seem to find a working example on how to decode the mp3 to buffer to convert it. |
If you want to decode the MP3 data, you need to use |
Yeah, i figured that out. |
@LinusU , I want to reduce bitrate on fly while the music is streaming, e.g.: "from a music file with 256kbps to 96kbps". Is it possible you post here an example to do that using node-lame? |
Finished my mp3-converter script by looking into streams and piping:
This will create a read stream from a "raw" file and convert it to a lower bitrate and output the "lower quality" file. @ithustle i believe you can use this script to pipe / use the output stream somewhere else (take a look at 'encoder.pipe'). Depends on what you want to do with the stream (buffer?). Hope this will help. |
@blubbll , awesome. It's working. |
@blubbll , actually is working but stuck after fews seconds song playing ... :( |
I had a similar issue, you may need to wait until the conversion is done (that's why i put "on finish" in my mp3-converter). |
Maybe @TooTallNate could do some kind of magic to solve my problem... |
I'm getting noise when I use this lib. My code:
const encoder = new lame.Encoder({ channels: 2, bitDepth: 16, sampleRate: 44100, bitRate: 128, outSampleRate: 22050, mode: lame.STEREO }); const song = fs.createReadStream("./music.mp3"); song.pipe(encoder).pipe(res)
Any help?
The text was updated successfully, but these errors were encountered: