Node.js FFMPEG Project to Add 3D & 8D Effect to Audio MP3 File Using apulsator Filter in Express
Page 1 of 1
Node.js FFMPEG Project to Add 3D & 8D Effect to Audio MP3 File Using apulsator Filter in Express
ffmpeg -i input.mp3 -af apulsator=hz=0.125 out.mp3
- Code:
npm init -y
- Code:
npm i express multer
- Code:
index.js
const express = require('express') const app = express() const multer = require('multer') var path = require('path') const bodyparser = require('body-parser') const {exec} = require('child_process') const port = 5000 app.use(bodyparser.urlencoded({extended:false})) app.use(bodyparser.json()) app.get('/', (req, res) => { res.sendFile(__dirname + "/index.html") }) var storage = multer.diskStorage({ destination: function (req, file, cb) { cb(null, 'uploads') }, filename: function (req, file, cb) { cb(null, Date.now() + path.extname(file.originalname)) //Appending extension } }) let outputfile var upload = multer({ storage: storage }).single('file'); app.post('/applyaudiofilter', (req, res) => { upload(req,res,(err) => { if(err){ console.log("error takes place in uploading file") }else{ outputfile = Date.now() + "output.mp3" console.log(req.file.path) exec(`ffmpeg -i ${req.file.path} -af apulsator=hz=0.125 ${outputfile}`,(err,stdout,stderr) => { if(err){ console.log(err) console.log("error in processing file") }else{ // download the file in the browser console.log(stdout) res.download(outputfile,(err) => { }) } }) } }) }) app.listen(port) |
- Code:
index.html
Before executing the project make sure that you create the
- Code:
uploads
Now you run the node.js project
- Code:
node index.js
From codingshiksha.com/javascript/node-js-ffmpeg-project-to-add-3d-8d-effect-to-audio-mp3-file-using-apulsator-filter-in-express
Similar topics
» extract audio from video file in linux
» phono to 1 point 5 mm jack for pc audio mixer audio plus phono passthrough cable
» PHP FILTER SECURITY EXAMPLES
» Wireshark Filter Out Results Example
» Allowing massive file upload sizes in linux apache2 webserver php.ini file edit
» phono to 1 point 5 mm jack for pc audio mixer audio plus phono passthrough cable
» PHP FILTER SECURITY EXAMPLES
» Wireshark Filter Out Results Example
» Allowing massive file upload sizes in linux apache2 webserver php.ini file edit
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum