Three.js: audio play() fail at ios 12

Created on 12 Jan 2019  ·  5Comments  ·  Source: mrdoob/three.js

Description of the problem

After my test, due to the addition of this line of code, the Google browser audio playback in ios (12.1) failed.(经过我测试,由于添加了这行代码,使得在ios(12.1) 的谷歌浏览器音频播放失败.)
file path is: src/audio/Audio.js

source.detune.value = this.detune;
Three.js version
  • [ ] Dev
  • [x] r100
  • [ ] ...
Browser
  • [ ] All of them
  • [x] Chrome for iOS
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [x] iOS
Hardware Requirements (graphics card, VR Device, ...)
Browser Issue

Most helpful comment

@Mugen87 I've tested the examples on iOS both Safari and Chrome. The Timing example doesn't work, the others do. I ran into this thread because of an error I'm experiencing on _Safari macOS (12.0.2 on Mojave)_ as well. It is the same Timing example that doesn't work.

In both iOS and macOS it returns the same error: TypeError: undefined is not an object (evaluating 'source.detune.value = this.detune')

All 5 comments

Unfortunately, I can't verify the issue since I have no iOS device. Maybe someone else with an iPhone can test with the Web Audio examples:

https://threejs.org/examples/?q=webaudio

@Mugen87 I've tested the examples on iOS both Safari and Chrome. The Timing example doesn't work, the others do. I ran into this thread because of an error I'm experiencing on _Safari macOS (12.0.2 on Mojave)_ as well. It is the same Timing example that doesn't work.

In both iOS and macOS it returns the same error: TypeError: undefined is not an object (evaluating 'source.detune.value = this.detune')

I can reproduce on macOS. Unfortunately, there is more stuff not working in Safari. The browser does not correctly evaluate the directional cone in webaudio_orientation. Besides certain sounds in webaudio_sandbox are not played because Safari does not support Ogg Vorbis.

Safari does not support AudioBufferSourceNode.detune so far. We could fix this by check if source.detune is undefined.

@1097364388 Would you please update your PR and implement the mentioned check in Audio.play() and Audio.setDetune()? The latter method should ideally print a warning if it is used when detune is undefined.

/cc @ngokevin

I've added a bug report at the Webkit issue tracker. Let's see what happens^^

https://bugs.webkit.org/show_bug.cgi?id=193445

@1097364388 Never mind. @ngokevin was faster^^

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scrubs picture scrubs  ·  3Comments

filharvey picture filharvey  ·  3Comments

akshaysrin picture akshaysrin  ·  3Comments

donmccurdy picture donmccurdy  ·  3Comments

jack-jun picture jack-jun  ·  3Comments