Random sound?

60 views
Skip to first unread message

Elliot Cole

unread,
Apr 18, 2016, 11:42:05 AM4/18/16
to Freesound API
Hello!

What's the best way to query the API for random sounds?

Thanks,
Elliot

Frederic Font

unread,
Apr 19, 2016, 5:15:51 AM4/19/16
to freeso...@googlegroups.com
Hi again,
Best way to get a random sound is to:
1) make an empty query
2) get the total number of results (count)
3) generate a random page number (number between 1 and count/page_size)
4) query that page
5) get a random sound from that page

We’ll consider adding a random sort option which would facilitate that, but for now it is not possible.

Cheers,


frederic


---
Frederic Font
Music Technology Group
Universitat Pompeu Fabra

Freesound | www.freesound.org
Audio Commons | www.audiocommons.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.
For more options, visit https://groups.google.com/d/optout.

Elliot Cole

unread,
Apr 19, 2016, 8:34:01 AM4/19/16
to freeso...@googlegroups.com
Got it -- great, thanks!

You received this message because you are subscribed to a topic in the Google Groups "Freesound API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/freesound-api/W60bvBW4pQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to freesound-ap...@googlegroups.com.

Gorka Egino Arroyo

unread,
Mar 4, 2025, 4:08:04 AMMar 4
to Freesound API
+1 for a way to get a random sound directly! It would cut the requests made for that purpose in half

2016(e)ko apirilaren 19(a), asteartea (14:34:01 (UTC+2)); ellio...@gmail.com erabiltzaileak hau idatzi zuen:
Reply all
Reply to author
Forward
0 new messages