Audio processing in browser with WebAssembly
Haapanen, Johannes (2023)
Kandidaatintyö
Haapanen, Johannes
2023
School of Engineering Science, Tietotekniikka
Kaikki oikeudet pidätetään.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi-fe20231221156644
https://urn.fi/URN:NBN:fi-fe20231221156644
Tiivistelmä
The aim of this thesis is to research using WebAssembly in a web browser environment. The usage of web browsers has increased greatly to a point where almost everyone has a device capable of running a browser. WebAssembly allows doing computationally intensive operations locally, but the question is if it is necessary in an environment where devices are getting faster by the day.
In this thesis, a web application was built which processes audio using two different implementations of the same algorithm. The first implementation was done with JavaScript which is supported by all browsers. The second implementation was done with WebAssembly.
The results of the research show, that the advantages of using WebAssembly are highly situational. The audio processing done in the thesis work turned out to be so light on modern hardware that the overhead of loading WebAssembly resulted in latency larger than just using JavaScript. Tämän kandidaatin työn tarkoituksena oli tutkia ja kartoittaa WebAssemblyn käyttöä äänen prosessoinnissa selain ympäristössä. Verkkoselaimien käyttö on yleistynyt pisteeseen, jossalähes jokaisella ihmisellä on käytössään laite, joka sisältää selaimen jossain muodossa. WebAssembly mahdollistaa laskennallisesti intensiivisten operaatioiden toteuttamisen paikallisesti mutta laitteiden nopeuden kasvaessa kysymyksesi muodostuu, että onko edes suorituskyvyltään tehokkaammalle ohjelmistoratkaisulle tarvetta?
Tässä kandidaatin työssä rakennettiin verkkosovellus, joka prosessoi ääntä käyttäen kahta eri toteutusta samasta algoritmista. Ensimmäinen toteutus tehtiin selainten yleisesti tukemalla JavaScript ohjelmointikielellä ja toinen toteutus tehtiin käyttäen WebAssemblyä.
Työn tuloksissa kävi ilmi, että WebAssemblyn käytön hyödyt riippuvat suuresti sen käyttökohteesta. Työssä tutkittu äänen prosessointi osoittautui niin kevyeksi työksi modernilla laitteistolla, että WebAssemblyn lataamiseen ja käyttöön liittyvät viiveet tekivät siitä hitaamman verrattuna JavaScript-toteutukseen.
In this thesis, a web application was built which processes audio using two different implementations of the same algorithm. The first implementation was done with JavaScript which is supported by all browsers. The second implementation was done with WebAssembly.
The results of the research show, that the advantages of using WebAssembly are highly situational. The audio processing done in the thesis work turned out to be so light on modern hardware that the overhead of loading WebAssembly resulted in latency larger than just using JavaScript.
Tässä kandidaatin työssä rakennettiin verkkosovellus, joka prosessoi ääntä käyttäen kahta eri toteutusta samasta algoritmista. Ensimmäinen toteutus tehtiin selainten yleisesti tukemalla JavaScript ohjelmointikielellä ja toinen toteutus tehtiin käyttäen WebAssemblyä.
Työn tuloksissa kävi ilmi, että WebAssemblyn käytön hyödyt riippuvat suuresti sen käyttökohteesta. Työssä tutkittu äänen prosessointi osoittautui niin kevyeksi työksi modernilla laitteistolla, että WebAssemblyn lataamiseen ja käyttöön liittyvät viiveet tekivät siitä hitaamman verrattuna JavaScript-toteutukseen.
