Comments (9)
@ArtskydJ , Working like a charm on both OS.
If sox gets mad about file types, you could try to use sox.js instead.
Well, on windows I have to download libmad-0.dll
and libmp3lame-0.dll
from here and add libmad-0.dll and libmp3lame-0.dll to the folder where SOX was installed to.
from sox-stream.
Sox is not bundled with this module. It needs to be on your path.
On your command line or terminal, can you run sox --help
?
from sox-stream.
Thanks to reply.
I'm trying with path too and still the same.
from sox-stream.
After install sox...
var lowerVolume = sox({ input: { volume: 0.2 }, output: { type: 'mp3' }}) const song = fs.createReadStream(assetUrl); song.pipe(lowerVolume).pipe(res)
Error: C:\ProgramData\chocolatey\lib\sox.portable\lib\sox.exe FAIL formats: can't determine type of file
C:\Users\ITHustle\AppData\Local\Temp\e8a693c6-4e52-4f46-b6cd-fd7488a6736d'`
from sox-stream.
If you run that from the command line, my guess is that you will get the same issue.
cat yourfile.ext | C:\ProgramData\chocolatey\lib\sox.portable\lib\sox.exe
So if you know your file extension, then set options.input.type
.
var lowerVolume = sox({ input: { volume: 0.2, type: 'flac' }, output: { type: 'mp3' }})
const song = fs.createReadStream(assetUrl); song.pipe(lowerVolume).pipe(res)
from sox-stream.
If sox gets mad about file types, you could try to use sox.js
instead.
https://github.com/Artskydj/sox.js
That way the sox executable is able to read the file however it wants, and might be better at detecting the type of the file. When the file is piped, sox is worse at detecting the file type
from sox-stream.
I'll try this on mac. I think windows really sucks it
from sox-stream.
@ArtskydJ , On mac is working :).
There is no way to make this working with an url? I want to transcode on fly...
And what about bitrate? Can I change it?
from sox-stream.
bitrate
sox-stream and sox.js just call sox
using child_process.
https://duckduckgo.com/?q=change+bitrate+with+sox&kp=1&t=ffab&ia=web
With sox, you can change the bitrate (depending on the file type) using -C
or --compression
, which in sox-stream looks like: { input: { ... }, output: { compression: '128' } }
make this work with a url?
You should be able to pipe from a network response into sox-stream, I think. sox-stream is more likely to handle the file if you provide the filetype.
from sox-stream.
Related Issues (20)
- VBR on MP3 files HOT 2
- Breaks with newer versions of node HOT 1
- Error: sox WARN mp3-util HOT 5
- Problem with MP3 files in OSX HOT 3
- Why write to temp file? HOT 3
- Pipe to on data HOT 3
- Segmentation fault in sox results in a zero-byte stream.
- Error: write EPIPE on use of trim effect HOT 2
- sox-stream does not work with file descriptor HOT 1
- replay-gain is required in typescript, but should not be HOT 1
- How create realtime reading stream ? HOT 1
- Streams & Pipe resulting in ENOENT HOT 5
- sox FAIL formats: no handler for detected file type `opus' HOT 1
- How to pass additional parameter (ex. the "-s" for "sox tempo -s 0.5") HOT 5
- Failure causes infinite loop HOT 4
- sox: invalid option -- - HOT 11
- How to connect additional output streams? HOT 2
- Get it works with bpm.js HOT 11
- Empty file HOT 10
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 sox-stream.