Difficulty using the js client for freesound with node

104 views
Skip to first unread message

sdfsdfsdf dsfsdfsdf

unread,
Feb 20, 2022, 4:47:21 PM2/20/22
to Freesound API
Hi, while attempting to use the freesound.js client for the API, I'm not quite sure how I'm supposed to make the function calls like getSound(), as the sound response seems to always be undefined when trying to implement this on node.js (server side). 

example would be: 
const freesound = require('./freesound.js')

freesound.setToken("YOUR_API_KEY_HERE");

freesound.getSound(96541, sound => {
console.log(sound)
})

which returns undefined, rather than any data.

I'm just starting my usage of this api, so is there something I'm missing/writing incorrectly?

Frederic Font Corbera

unread,
Feb 25, 2022, 6:41:34 AM2/25/22
to freeso...@googlegroups.com
Hi,

Did you put an actual real api key there?

Cheers,

frederic


--
Frederic Font - ffont.github.io
Music Technology Group, UPF - mtg.upf.edu
Freesound - freesound.org



--

---
You received this message because you are subscribed to the Google Groups "Freesound API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freesound-ap...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/freesound-api/45ca2c9a-988c-43ab-a55f-6e185ab52bc0n%40googlegroups.com.

Fandroide

unread,
Dec 7, 2022, 3:50:47 AM12/7/22
to Freesound API
Hi,
For Node.js recommend using this library:

freesound.js can give CORS errors as far as I've seen

José Viana

unread,
Dec 13, 2022, 12:52:01 AM12/13/22
to Freesound API
Hi, thanks for all!

is it possible to play the sounds through the API on my own website? similar to embed mode.

I'm using next js.

Reply all
Reply to author
Forward
0 new messages