Using the xeno-canto API
This Max patch retrieves bird call data from the xeno-canto API, then plays an mp3 file of the bird call using the URL from the query.
If you’d like to modify this patch to play the sounds of other birds, you can get the species names from: http://www.xeno-canto.org
Click to hear the bird call from the patch:
- nothing-detector.maxpat (for tracking progress of html request)
- none required
- Open the Max patch: bird-call4.maxpat
- Select a bird from the menu. Wait a few seconds. If the hit-counter increases above zero then the search was successful.
- Click the button to start audio.
- Click the button to play a random recording from the query
There are two html queries. The first query retrieves an array of recording records for a selected bird. The second query downloads the .mp3 file with the actual recording.
The patch uses [dict] and [maxurl] to format execute the first query. Then it uses [jit.uldl] to download the .mp3 file.