CORS Audio Loading
See original GitHub issueStruggling to get past the following error when loading audio files from s3:
MediaElementAudioSource outputs zeroes due to CORS access restrictions for <some s3 url>
The waveform loads properly but you can’t playback the audio.
I’m using the xhr option, but it’s unclear what to pass in as the authorization token. I tried using the S3 access key id, I also tried generating this credential string: s3 credential string to no avail.
Here is my CORS policy:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedOrigin>http://*</AllowedOrigin>
<AllowedOrigin>https://*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
I’ve looked at similar issues but they weren’t helpful. Any idea what I’m doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
HTML5 Audio, Web Audio API, CORS and Firefox
The same-origin policy says that scripts run on some origin cannot read resources from another origin. (An origin is a domain, plus a...
Read more >CORS issue from audio file in same directory? - SitePoint
Eventually (working towards this), I intend to use Spring/Thymeleaf and Web Audio API to directly load PCM into an AudioBuffer, and play sounds ......
Read more >The Embed Audio element - HTML - MDN Web Docs - Mozilla
The HTML element is used to embed sound content in documents. ... attribute indicates whether to use CORS to fetch the related audio...
Read more >HTML Audio/Video DOM Reference - W3Schools
load (), Re-loads the audio/video element. play(), Starts playing the audio/video ... crossOrigin, Sets or returns the CORS settings of the audio/video.
Read more >Label Studio Documentation — Troubleshoot Label Studio
Image/audio/resource loading error while labeling. The most common mistake while resource loading is CORS (Cross-Origin Resource Sharing) problem or Cross ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this problem too, try the solution in #2014
you can create your own Audio object and set crossOrigin = ‘anonymous’ which seems to let chrome and firefox load cross origin audio.
@entonbiba we have no problems, but @alittlebitweird