Closed MartinTremblay closed 2 months ago
the LFO is going to be too low for you to hear (1hz) and it's connected directly to the speaker (toDestination()
), try instead to connect the LFO to the oscillators detune or gain or some attribute that you want to modify with the LFO.
No I mean, the problem only occurs on iOS.
On other device (windows, android), we can hear a pulse with this code, but no on iOs. The value of the frequency doesn't really matter.
https://codesandbox.io/p/sandbox/tonejs-forked-y8r9ln?file=%2Fsrc%2Findex.js%3A6%2C1
Hi @MartinTremblay, I think what you're experiencing is the limiter or the absence of it in various browsers. It sounds the same everywhere when reducing the volume with a Gain
.
https://stackblitz.com/edit/vitejs-vite-zslwp4?file=src%2Fmain.ts
Okay, but using straight AudioApi I can replicate the same effect on iOS.
https://codesandbox.io/p/sandbox/tonejs-forked-8dk3tv?file=%2Fsrc%2Findex.js%3A13%2C19
That's what I was trying to say with the comment above. It's not specified what the browser should do with a value outside of the range [-1, 1].
As far as I know Firefox and Safari do nothing and let the operating system decide what to do. Chrome has a limiter.
The LFO don't seem to have any effect on iOS.
This code works on desktop and android, but the oscillator is unchanged on iOS.