Play using Web Audio

This is to demonstrate an issue on iOS and iPadOS with Web Audio and external Bluetooth speakers.

1. Disconnect all external Bluetooth devices and set audio output of device to internal speakers.
Close and re-open this page if any Bluetooth devices were connected.
2. Click / tap on the "Init" button.
An alert is shown giving the AudioContext sampleRate. This is likely to be 48000.
3. Click / tap on the "Play" button.
The audio will play.
4. Click / tap on the "Stop" button.
The audio will stop. Leave this page open.
5. Switch to the Settings app and connect to an external Bluetooth speaker.
6. Switch back to this page
7. Click / tap on the "play" button.
The audio will play but is very likely to be badly distorted and play at the wrong speed.
Once the page is in this state, using the "Init" button again does not fix the audio.
Refreshing may fix the problem (but may require several refreshes)
8. With the external Bluetooth speaker still connected, close the page and reopen it.
Follow steps 2 to 4 and the audio will play ok (with the sampleRate showing as 41000).
9. Note that the problem does not occur with audio in an HTML

Play using audio element