How to download and load audio files from jweb into buffer~ (not jweb~)
Hi everyone,
I'm working on a Max patch that uses [jweb] (the regular web browser object, not [jweb~]) to display an interactive map interface showing field recording locations from aporee.org.
When a user clicks on a location in the browser, my gui.html sends the audio file URL to Max via:
max.outlet('audio_url', url, metadata);
```
**My goal:** Load this MP3 file into a `[buffer~]` so I can play it back.
**What I've tried:**
1. **Direct URL to buffer~** - Doesn't work, the URLs have CORS/403 protection
2. **Node for Max with http/https modules** - Gets HTTP 403 errors from the server
3. **curl/wget via shell** - Also blocked with 403
4. **yt-dlp** - Permission and dependency issues
**My current setup:**
```
[jweb @name gui]
|
[route audio_url]
|
[prepend replace]
|
[buffer~ topophonia_sample]This works for local files but not for remote HTTPS URLs from aporee.org.
Question: What's the best/most reliable way to:
Download an audio file from an HTTPS URL provided by jweb
Load it into a buffer~ for playback
Should I be using a different approach entirely? Any examples would be greatly appreciated!
Running Max 8 on macOS 10.14.6.
Thanks!
Problem solved after hours of trying with maxurl that kept loading the same cached file, completely ignoring new URLs. The definitive solution: Replace maxurl with [shell] + curl: