Using the lame-converter with glitch?


#1

I have a project where i want to create a prototype which lowers mp3 quality, i got everything spread out unless the lame converter itself.
i keep getting an “enoent”,
(spawn lame ENOENT)
which often seems to come when i try to use the package “node-lame” and the lame path isn’t configured correctly.


#2

Hey @blubbll can you provide the full error message and/or your project name?


#3

@cori project is ‘nr6on-splitter’,
full message is:

(node:23257) UnhandledPromiseRejectionWarning: **Error: spawn lame ENOENT**
2:18 AM
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
2:18 AM
at onErrorNT (internal/child_process.js:362:16)
2:18 AM
at _combinedTickCallback (internal/process/next_tick.js:139:11)
2:18 AM
at process._tickCallback (internal/process/next_tick.js:181:9)
2:18 AM
(node:23257) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error 
originated either by throwing inside of an async function without a catch block, or by 
rejecting a promise which was not handled with .catch(). (rejection id: 1)
2:18 AM
(node:23257) [DEP0018] DeprecationWarning: Unhandled promise rejections are 
deprecated. In the future, promise rejections that are not handled will terminate the Node.js 
process with a non-zero exit code.

#4

lamejs is no option, because it instantly uses way too much ram.
i heard lame is pretty okay and i couldn’t find an alternative for it yet.


#5

Ok, what I think is happening here is that the node-lame module can’t find the LAME encoder when it tries to spawn a process for it, which is why you’re getting the ENOENT error message. You can confirm this by going into the project’s console and executing which lame, which will return null, meaning that the container’s OS can’t find it. I don’t know if you tried installing LAME itself with a workaround, since this won’t work in your container, but even if you did it seems like your project doesn’t know where it is.

You might try using this instead, which claims to package its own LAME and so presumably can find it without difficulty. I replaced node-lame with this in a remix of your project and it didn’t consume too much space, so from that perspective it might work fine - I didn’t try refactoring your code to use it instead of node-lame, though.


#6

well, i tried to search for a manual way, say for like if it was a windows environment, to run it as a portable library. but i will check out TooTallNate’s node-lame fork, thank you, that’s a nice find!


#7

@cori it seems to work, thank you. gonna need some more configuration about sample rate etc., but that’s fine. i can continue working on that. big thanks!