Hey, I am
Front-end developer developing anything that comes into my mind.
Gimme-the-song is a simple lib that recognize a music from a audio file. Its a Javascript implementation of AcoustId Chromaprint and their service.
License: MIT License
Hi @joaodjtr,
I'm getting the error: gimme-the-song-fpcalc-linux: command not found
on my Vercel deployment (Linux). However, it is working perfectly on my local Windows environment, and my code is completely OS-independent.
Here's the complete error log:
{"errorType":"Error","errorMessage":"Command failed: gimme-the-song-fpcalc-linux /tmp/Numb.mp3\n/bin/sh: gimme-the-song-fpcalc-linux: command not found\n","code":127,"killed":false,"signal":null,"cmd":"gimme-the-song-fpcalc-linux /tmp/Numb.mp3","stack":["Error: Command failed: gimme-the-song-fpcalc-linux /tmp/Numb.mp3","/bin/sh: gimme-the-song-fpcalc-linux: command not found",""," at ChildProcess.exithandler (child_process.js:308:12)"," at ChildProcess.emit (events.js:315:20)"," at maybeClose (internal/child_process.js:1048:16)"," at Socket.<anonymous> (internal/child_process.js:439:11)"," at Socket.emit (events.js:315:20)"," at Pipe.<anonymous> (net.js:673:12)"]}
Here's my Next.js source code:
import multer from "multer";
import nextConnect from "next-connect";
import { gimme, setGimmeKey } from 'gimme-the-song'
import { unlink } from 'fs'
import { tmpdir } from 'os'
const handler = nextConnect({
onError: (err, _req, res) => {
console.log(err)
res.status(501).json({ error: err.message })
},
onNoMatch: (req, res) => res.status(405).json({ error: req.method + " not allowed"})
})
.use(
multer({
storage: multer.diskStorage({
destination: tmpdir(),
filename: (_req, file, cb) => cb(null, file.originalname.split(' ').join(''))
})
})
.single('audiofile')
)
.post((req, res) => {
setGimmeKey(process.env.ACOUSTIC_API_KEY)
gimme(req.file.path, {}, ({ track, trackVariants }) => {
unlink(req.file.path, err => {
if (err)
throw err
res.status(200).json({
track,
trackVariants: trackVariants.filter(variant => !!variant.title && track.title !== variant.title)
})
})
})
})
export default handler
export const config = {
api: {
bodyParser: false
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.