Why doesn’t this make any sound?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why doesn’t this make any sound??

The oscillator in the code below doesn’t seem to work. I’ve searched up loads of tutorials online, and they all give me the same answer, yet nothing happens. Why? If you give me the answer I need, then you can have something from the lolly jar below! https://code.sololearn.com/WIwopM3Du51x/?ref=app P.S I’m using my iPad on the SoloLearn iOS app. ↤↤↤↤↤ ᏖᏂᏋ ᏝᎧᏝᏝᎩ ᏠᏗᏒ ↦↦↦↦↦ ︹︹︹ |______| | | |🍪🍪| |🍭🍭| ▔▔▔

4th Nov 2018, 8:28 AM
Rowsej
Rowsej - avatar
10 Answers
+ 4
I had no idea, let's wait for other suggestion. Other than that could be hardware problem ? Check your device sound, by running the other's code thats working for you before
4th Nov 2018, 9:03 AM
Taste
Taste - avatar
+ 3
It seems your phone doesnt recognize WebkitAudioContext, try to change it to AudioContext Or use both, for better compatibility new (window.webkitAudioContext || window.AudioContext)();
4th Nov 2018, 8:41 AM
Taste
Taste - avatar
+ 3
I just try the method i mentioned above, and it works i can hear the sound. Probably due incompatibility, you can check here https://developer.mozilla.org/en-US/docs/Web/API/AudioContext
4th Nov 2018, 8:51 AM
Taste
Taste - avatar
+ 3
Wierd... Let's try this https://code.sololearn.com/W5pu5X6gQOHS/?ref=app It's basicly your code, dont worry i'll delete it ASAP I just tested it again and It's working
4th Nov 2018, 8:57 AM
Taste
Taste - avatar
+ 2
Taste but I see other codes with an oscillator in them and they work!!
4th Nov 2018, 8:53 AM
Rowsej
Rowsej - avatar
+ 2
Can you link one of code that WORKS on your device?
4th Nov 2018, 10:49 AM
KrOW
KrOW - avatar
+ 1
Taste No, I tried that before, and it didn’t work.
4th Nov 2018, 8:43 AM
Rowsej
Rowsej - avatar
+ 1
Taste nothing.
4th Nov 2018, 8:58 AM
Rowsej
Rowsej - avatar
4th Nov 2018, 9:08 PM
Rowsej
Rowsej - avatar
+ 1
Taste KrOW I fixed the problem! You need to put the oscillator code inside an event for it to work. The code is updated now, you can run it, then press hi! And you can both have a lolly!
4th Nov 2018, 9:30 PM
Rowsej
Rowsej - avatar