News for hackers. Stuff that matters.
Re:Show HN: I built website for sharing Drum Patterns by wesz on Sunday March 23, 2025 @03:51PM (#43455376)
Interesting, i already do something similar and never had a chance to check if it really works. Here is my code:

var buffer = dm.audio.createBuffer(1, 1, dm.samplerate); var source = dm.audio.createBufferSource();

source.buffer = buffer; source.connect(dm.audio.destination);

if (source.start) { source.start(0); } else { source.noteOn(0); }

Re:Show HN: I built website for sharing Drum Patterns by jaflo on Sunday March 23, 2025 @05:55PM (#43456210)
I believe you need to use the audio element specifically. The Web Audio API is subject to different restrictions than the audio element. I used a similar approach on Audjust: https://www.audjust.com/blog/unmute-web-audio-on-ios/

(nice site you created btw! I love seeing audio stuff for the web)

Re:Show HN: I built website for sharing Drum Patterns by wesz on Sunday March 23, 2025 @06:25PM (#43456389)
Thanks mate! I'll implement your solution:)