4 years ago
Wed Jun 17, 2020 11:05am PST
Help 466M people with hearing loss in 16LOC JavaScript
Lately, quite interesting hearing aid app pops in App store - it was Chatable app (chatableapps.com) which clears background noise from mic and plays it back via headphones. Which should help people with hearing loss. As a bone-conduction headphones developer I liked the concept and what surprises me the most is that current desktop/mobile browsers support echoCancellation and noiseSuppression - so the idea is very very simple ...

  navigator.mediaDevices
                    .getUserMedia({
                        video: false,
                        audio: {
                            echoCancellation: true,
                            noiseSuppression: true,
                            autoGainControl: false,
                        },
                    })
                    .then((stream) => {
                        var aCtx = new (window.AudioContext || window.webkitAudioContext)();
                        var analyser = aCtx.createAnalyser();
                        var microphone = aCtx.createMediaStreamSource(stream);
                        microphone.connect(analyser);
                        analyser.connect(aCtx.destination);
                    })
                    .catch((e) => alert(e.name + ': ' + e.message));

To make it more viable - here is the PWA - https://sentienhq.com/hearplus/ - which runs offline (after "add to homescreen") but i was not able to test it on different phones - sorry

full pwa src: https://github.com/sentienhq/Hearing-Aid

comments:
add comment
loading comments...