Skip to content

Commit 8f4fb0d

Browse files
javier-godoypaodb
authored andcommitted
fix: enhance the bell sound
1 parent 3201426 commit 8f4fb0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/resources/META-INF/frontend/fc-xterm/xterm-element.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ export class XTermElement extends LitElement implements TerminalMixin {
146146
term.write(e.replace(/\r/g,'\x1b[<N\n'));
147147
});
148148

149-
//https://gist.github.com/xem/670dec8e70815842eb95
150-
term.setOption('bellSound','data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU'+Array(500).join('123'));
149+
//https://gist.github.com/literallylara/7ece1983fab47365108c47119afb51c7
150+
//(C) Lara Sophie Schütt 2016, CC0
151+
for(var i=44100*0.1,d="";i--;)d+=String.fromCharCode(~~((Math.sin(i/44100*2*Math.PI*800)+1)*128));
152+
term.setOption('bellSound',"data:Audio/WAV;base64,"+btoa("RIFFdataWAVEfmt "+atob("EAAAAAEAAQBErAAARKwAAAEACABkYXRh/////w==")+d));
151153

152154
term.attachCustomKeyEventHandler(ev => {
153155
if (ev.type!=='keydown') return false;

0 commit comments

Comments
 (0)