<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>195043</bug_id>
          
          <creation_ts>2019-02-26 03:47:41 -0800</creation_ts>
          <short_desc>REGRESSION: CrossOrigin Audio with WebAudio API not working with Soundcloud</short_desc>
          <delta_ts>2025-10-26 15:37:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Audio</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gregg Tavares">gman</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>david</cc>
    
    <cc>hvianna</cc>
    
    <cc>jer.noble</cc>
    
    <cc>jjv360</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1510003</commentid>
    <comment_count>0</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2019-02-26 03:47:41 -0800</bug_when>
    <thetext>Sometime between I think October and now Safari stopped working with the WebAudio API and Soundcloud for me.

I spent some time putting together a repo.

Here&apos;s a relatively simple example

https://greggman.github.io/doodles/test/safari-soundcloud-webaudio-issue/safari-soundcloud-webaudio-issue.html

All it does is setup an audio tag, and the WebAudio API to a visualization of the FFT data from the WebAudio API and it uses either an mp3 from twgljs.org or from soundcloud.com (with permission and CORS headers set in both cases). PS: My client id is in the sample. Please don&apos;t abuse it


Trie both Safari 12 and Tech Preview 

REPO:

Before clicking start UNCHECK the &quot;Use Soundcloud&quot; box. In this case it will use an mp3 file from https://twgljs.org (so the file is cross origin) You&apos;ll see it works.

Now refresh the page, this time leave the &quot;Use Soundcloud&quot; box checked, click start. In this case it will ask soundcloud for the url for a track on their site. It will then use that URL on an audio.src (same as the code above)
You&apos;ll hear like 0.1 second of the audio and then nothing. If you check the audio.currentTime you&apos;ll see it&apos;s incrementing

Note: This works in Firefox and Chrome and it used to work in Safari on both MacOS and iOS last summer. Sometime since then it broke. I have didn&apos;t have time to make a small repo until now.

Here&apos;s the network requests/responses if they are helpful

When using twgljs.org for the mp3

----------


Request
:method: GET
:scheme: https
:authority: twgljs.org
:path: /examples/sounds/DOCTOR%20VOX%20-%20Level%20Up.mp3
Accept: */*
Origin: http://localhost:8080
Connection: keep-alive
Range: bytes=0-1
Host: twgljs.org
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.2 Safari/605.1.15
Referer: http://localhost:8080/safari-webaudio-issue.html
Accept-Encoding: identity
X-Playback-Session-Id: 46C03A8D-36FF-48B6-8870-D4FF43B26DE9

Response
:status: 206
Content-Type: audio/mp3
Access-Control-Allow-Origin: *
Set-Cookie: __cfduid=d2271506b3da4905171db469d919ae8151551177241; expires=Wed, 26-Feb-20 10:34:01 GMT; path=/; domain=.twgljs.org; HttpOnly
Expires: Tue, 26 Feb 2019 10:44:01 GMT
Cache-Control: max-age=600
Date: Tue, 26 Feb 2019 10:34:01 GMT
Content-Length: 2
ETag: &quot;5c7430da-7c1727&quot;
Content-Range: bytes 0-1/8132391
Last-Modified: Mon, 25 Feb 2019 18:15:54 GMT
Server: cloudflare
x-github-request-id: DBBC:6671:8529F:AFBA6:5C751619
expect-ct: max-age=604800, report-uri=&quot;https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;
cf-ray: 4af1c1bcde9da5fc-NRT

Request
:method: GET
:scheme: https
:authority: twgljs.org
:path: /examples/sounds/DOCTOR%20VOX%20-%20Level%20Up.mp3
Accept: */*
Origin: http://localhost:8080
Connection: keep-alive
Range: bytes=0-65535
Host: twgljs.org
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.2 Safari/605.1.15
Referer: http://localhost:8080/safari-webaudio-issue.html
Accept-Encoding: identity
X-Playback-Session-Id: 46C03A8D-36FF-48B6-8870-D4FF43B26DE9

Response
:status: 206
Content-Type: audio/mp3
Access-Control-Allow-Origin: *
Set-Cookie: __cfduid=d2271506b3da4905171db469d919ae8151551177241; expires=Wed, 26-Feb-20 10:34:01 GMT; path=/; domain=.twgljs.org; HttpOnly
Expires: Tue, 26 Feb 2019 10:44:01 GMT
Cache-Control: max-age=600
Date: Tue, 26 Feb 2019 10:34:01 GMT
Content-Length: 65536
ETag: &quot;5c7430da-7c1727&quot;
Content-Range: bytes 0-65535/8132391
Last-Modified: Mon, 25 Feb 2019 18:15:54 GMT
Server: cloudflare
x-github-request-id: DD04:5D7B:1F71C4:29350E:5C751619
expect-ct: max-age=604800, report-uri=&quot;https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;
cf-ray: 4af1c1bfcafea5fc-NRT
----------


When using soundcloud for the mp3




Request
GET /tracks/113332220/stream
Accept: */*
Range: bytes=0-1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.2 Safari/605.1.15
Referer: http://localhost:8080/safari-webaudio-issue.html
Accept-Encoding: identity
Connection: Keep-Alive
Origin: http://localhost:8080
X-Playback-Session-Id: 3C505FFB-790C-4469-8131-090181944003

Redirect Response
302 Moved Temporarily
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, PUT, POST, DELETE
Access-Control-Expose-Headers: Date
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
Cache-Control: no-cache
Location: https://cf-media.sndcdn.com/93KvqnPvC3eJ.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vOTNLdnFuUHZDM2VKLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1NTExNzc5NzR9fX1dfQ__&amp;Signature=p31o0i2YMOu2q9vcZzOe-BaeKKYl~6JEEUmPyzeVA127VwLcqDlMnhJCzSXeQiSgzI4VD5NpBVsVc1wwZ14eTo8R47268qMsQVO6nCG6PWUvGPe2X1ZR14zrIMOuybp9toUeCjQy6fU1Kl5OCUMuZ2XWo6rm0GMT3xYd~AcX9UCcJGgjlCb25zypDn4MI7hH0rtPd5utFepIg9xTDIMuPnmOzOZ2Rg7jbGdW1D4wSnBcyDlz2OGBtrqrbmOS~l9uEwGIY4CE-luNOHyAx2vgSy3iga0~muoAGzigxrUbAAXMRJMYNy~RaLSkuYoivtwpVHlgFL-Rs8EzT~ZW2ogBsg__&amp;Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ
Date: Tue, 26 Feb 2019 10:40:35 GMT

Request
GET /93KvqnPvC3eJ.128.mp3 HTTP/1.1
Accept: */*
Origin: null
Range: bytes=0-1
Host: cf-media.sndcdn.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.2 Safari/605.1.15
Referer: http://localhost:8080/safari-webaudio-issue.html
Connection: keep-alive
X-Playback-Session-Id: 3C505FFB-790C-4469-8131-090181944003

Response
HTTP/1.1 206 Partial Content
Access-Control-Allow-Methods: GET
Cache-Control: max-age=252460800
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Content-Length: 2
Via: 1.1 6dd1fb730ba34e9c2dcda211a88fd854.cloudfront.net (CloudFront)
Date: Tue, 26 Feb 2019 09:11:12 GMT
Connection: keep-alive
Age: 5364
Access-Control-Max-Age: 3000
Content-Type: audio/mpeg
ETag: &quot;002b0b87588401d0369537da6257085e&quot;
Content-Range: bytes 0-1/3501243
Last-Modified: Thu, 16 Jun 2016 01:15:28 GMT
Server: AmazonS3
x-amz-meta-job: 93KvqnPvC3eJ
x-amz-meta-duration: 218848
x-amz-meta-bitrate: 128
x-amz-server-side-encryption: AES256
X-Amz-Cf-Id: gHrglde0jt5570Ib1n3zDO7DiwwaSkungZBOo1bj0qjc2Xy7CEWyrw==
x-amz-version-id: r99TAWvBU6m9Vz73goT02AgaTx.kVOEy
X-Cache: Hit from cloudfront

Query String Parameters
Policy: eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vOTNLdnFuUHZDM2VKLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1NTExNzc5NzR9fX1dfQ__
Signature: p31o0i2YMOu2q9vcZzOe-BaeKKYl~6JEEUmPyzeVA127VwLcqDlMnhJCzSXeQiSgzI4VD5NpBVsVc1wwZ14eTo8R47268qMsQVO6nCG6PWUvGPe2X1ZR14zrIMOuybp9toUeCjQy6fU1Kl5OCUMuZ2XWo6rm0GMT3xYd~AcX9UCcJGgjlCb25zypDn4MI7hH0rtPd5utFepIg9xTDIMuPnmOzOZ2Rg7jbGdW1D4wSnBcyDlz2OGBtrqrbmOS~l9uEwGIY4CE-luNOHyAx2vgSy3iga0~muoAGzigxrUbAAXMRJMYNy~RaLSkuYoivtwpVHlgFL-Rs8EzT~ZW2ogBsg__
Key-Pair-Id: APKAJAGZ7VMH2PFPW6UQ

Request
GET /93KvqnPvC3eJ.128.mp3 HTTP/1.1
Accept: */*
Origin: http://localhost:8080
Connection: keep-alive
Range: bytes=0-16383
Host: cf-media.sndcdn.com
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.2 Safari/605.1.15
Referer: http://localhost:8080/safari-webaudio-issue.html
Accept-Encoding: identity
X-Playback-Session-Id: 3C505FFB-790C-4469-8131-090181944003

Response
HTTP/1.1 206 Partial Content
Access-Control-Allow-Methods: GET
Cache-Control: max-age=252460800
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Content-Length: 16384
Via: 1.1 6dd1fb730ba34e9c2dcda211a88fd854.cloudfront.net (CloudFront)
Date: Tue, 26 Feb 2019 09:11:12 GMT
Connection: keep-alive
Age: 5364
Access-Control-Max-Age: 3000
Content-Type: audio/mpeg
ETag: &quot;002b0b87588401d0369537da6257085e&quot;
Content-Range: bytes 0-16383/3501243
Last-Modified: Thu, 16 Jun 2016 01:15:28 GMT
Server: AmazonS3
x-amz-meta-job: 93KvqnPvC3eJ
x-amz-meta-duration: 218848
x-amz-meta-bitrate: 128
x-amz-server-side-encryption: AES256
X-Amz-Cf-Id: 3RYfpEU2mZYlK01Jnv3T6dhFpFDFTDySLQILOMn3-yGG6TO0XAJewA==
x-amz-version-id: r99TAWvBU6m9Vz73goT02AgaTx.kVOEy
X-Cache: Hit from cloudfront

Query String Parameters
Policy: eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vOTNLdnFuUHZDM2VKLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1NTExNzc5NzR9fX1dfQ__
Signature: p31o0i2YMOu2q9vcZzOe-BaeKKYl~6JEEUmPyzeVA127VwLcqDlMnhJCzSXeQiSgzI4VD5NpBVsVc1wwZ14eTo8R47268qMsQVO6nCG6PWUvGPe2X1ZR14zrIMOuybp9toUeCjQy6fU1Kl5OCUMuZ2XWo6rm0GMT3xYd~AcX9UCcJGgjlCb25zypDn4MI7hH0rtPd5utFepIg9xTDIMuPnmOzOZ2Rg7jbGdW1D4wSnBcyDlz2OGBtrqrbmOS~l9uEwGIY4CE-luNOHyAx2vgSy3iga0~muoAGzigxrUbAAXMRJMYNy~RaLSkuYoivtwpVHlgFL-Rs8EzT~ZW2ogBsg__
Key-Pair-Id: APKAJAGZ7VMH2PFPW6UQ




Note I tried to run the bisect-builds tool but it failed to run a single version of safari successful. It would download and start but no pages would load, not apple.com, not anything. One started loading icloud.com but kept failing and refreshing, after 5 different revisions I gave up (T_T)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1510083</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-02-26 10:42:16 -0800</bug_when>
    <thetext>&lt;rdar://problem/48405751&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1510655</commentid>
    <comment_count>2</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-02-27 15:47:43 -0800</bug_when>
    <thetext>In the soundcloud case, I believe it fails the &quot;Has Single Security Origin&quot; check because of the 301 redirect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1510658</commentid>
    <comment_count>3</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2019-02-27 15:49:38 -0800</bug_when>
    <thetext>And yes, in Mojave, we added cross-site security checks to the MediaElementSourceNode; this is likely fallout from that security fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1539389</commentid>
    <comment_count>4</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2019-05-27 07:47:21 -0700</bug_when>
    <thetext>This doesn&apos;t seem to have anything to do with re-directing.

Here&apos;s another example which doesn&apos;t seem to use a redirect but still fails 

https://codepen.io/greggman/pen/wbXXWp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1681683</commentid>
    <comment_count>5</comment_count>
    <who name="Josh">jjv360</who>
    <bug_when>2020-08-20 07:05:08 -0700</bug_when>
    <thetext>Over a year later and it&apos;s still broken! I needed to create a positional audio stream using THREE.js, and on Safari (even on iOS 14 beta as well) the volume simply doesn&apos;t change. In fact, it&apos;s like the audio element isn&apos;t a part of the AudioContext&apos;s graph at all. 

Maybe &quot;createMediaElementSource&quot; is actually not doing anything when the audio&apos;s source is an http stream? I tried commenting out createMediaElementSource in the codepen above, and it is exactly the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154354</commentid>
    <comment_count>6</comment_count>
    <who name="David Mancini">david</who>
    <bug_when>2025-10-26 15:37:12 -0700</bug_when>
    <thetext>It is now 2025.  This issue STILL isn&apos;t fixed.  This works in every major browser BUT Safari.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>