You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch lamejs@1.2.0 for the project I'm working on.
I encountered an issue in Firefox (v96.0.3) that variable for the right channel is not passed to the encodeBuffer despite there are 2 channels. To prevent that I've added extra validation of the presence of that right channel. That could probably simply replace checking for number of channels instead of extend that validation condition but I didn't investigate the code deeper and as a quick fix I went with the safest solution from my point of view.
Here is the diff that solved my problem:
diff --git a/node_modules/lamejs/src/js/index.js b/node_modules/lamejs/src/js/index.js
index 7539d66..f18e7c7 100644
--- a/node_modules/lamejs/src/js/index.js+++ b/node_modules/lamejs/src/js/index.js@@ -115,7 +115,8 @@ function Mp3Encoder(channels, samplerate, kbps) {
var mp3buf = new_byte(mp3buf_size);
this.encodeBuffer = function (left, right) {
- if (channels == 1) {++ if (channels == 1 || !right) {
right = left;
}
assert(left.length == right.length);
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
lamejs@1.2.0
for the project I'm working on.I encountered an issue in Firefox (v96.0.3) that variable for the
right
channel is not passed to theencodeBuffer
despite there are 2channels
. To prevent that I've added extra validation of the presence of that right channel. That could probably simply replace checking for number of channels instead of extend that validation condition but I didn't investigate the code deeper and as a quick fix I went with the safest solution from my point of view.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: