Comments (5)
Hi @VRciF
I know this is very old, but did you ever find a solution? I am in pretty much the same situation.
Thanks
from lamejs.
There is no easy solution to splicing multiple mp3 files seamlessly. Why it's hard and how to do it is described in the LAME Technical FAQ linked above.
But it sounds like you are trying to fix the wrong thing. Instead of transferring multiple mp3 files try to send chunks of a single mp3 stream.
from lamejs.
Hi @geeee,
Thanks so much for your response and your contributions to this very useful resource. I have read the FAQ, and to me it sounds like the issue concerns the spread of data across multiple frames. I should clarify that my plan for splicing together these multiple files was to just convert each to WAV format (16 bit linear PCM) and then to splice those files together. I figured that if I knew the padding added onto each MP3 file, I would be able to just ignore the WAV data (after conversion) that fell into the padding. My thinking was that the conversion to WAV (server side, by a different library) would handle to combination of data from multiple frames. Is there something else I am missing that would cause this not to work? My main purpose for converting the data into MP3 format in the browser is just to decrease bandwidth usage.
I'll look into the process of sending an MP3 stream in chunks, since I'm sure that would be the more elegant solution. I didn't consider this as strongly before because I was just going for something quick and dirty that I could easily work into the framework of an existing project where WAV data is put in base64 and then sent over a websocket at a certain interval. I thought it might be quick to just throw in the extra step of converting the WAV data to MP3 before the base64 encoding so I could make minimal changes. Seems like it might not be that simple though I guess.
from lamejs.
Padding at the start is going to be 576 samples. Padding at the end will vary. At the very least it's going to be 288 samples. And more silence to make the total number of samples exact multiple of 1152. And on top of that decoders might also contribute by adding even more silence.
Try to generate one PCM chunk with values of all of the samples set to maximum. After encoding/decoding this chunk it's going to be ease to tell an exact number of samples added to the start and the end of the chunk.
from lamejs.
Thanks very much, I will try that!
from lamejs.
Related Issues (20)
- Working With MediaRecorder API HOT 1
- Dependency on module mic-recorder-to-mp3 HOT 1
- lamejs not working with angular 8 -- Uncaught ReferenceError: Lame is not defined HOT 3
- Silent MP3 file when converting output from Azure Speech-to-Text javascript SDK HOT 2
- Is it possible to use VBR (variable bit rate) HOT 1
- Blob to MP3 HOT 1
- lamejs.WavHeader.readHeader - Uncaught (in promise) TypeError: Cannot read property 'dataOffset' of undefined HOT 3
- There is a problem with the sound quality in the node environment
- Deleted
- recorder wavdata to mp3 causes ui rendering block HOT 2
- window not defined
- "MPEGMode is not defined" HOT 21
- [Firefox] Data from right channel is not passed to encoder despite there are expected two channels
- MPEGMode is not defined HOT 5
- No sound in trimmed & encoded audio blob, Vue 2. Why?
- wav转mp3的时候lampjs报"ReferenceError: MPEGMode is not defined" HOT 10
- Cannot read properties of undefined (reading 'println') HOT 1
- can i convert amr to mp3?
- License clarification
- zhuker/lamejs 打包报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lamejs.