Use const everywhere
This commit is contained in:
+6
-6
@@ -12,11 +12,11 @@ import { ITerminal, ISoundManager } from './Types';
|
|||||||
export const DEFAULT_BELL_SOUND = 'data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==';
|
export const DEFAULT_BELL_SOUND = 'data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==';
|
||||||
|
|
||||||
export class SoundManager implements ISoundManager {
|
export class SoundManager implements ISoundManager {
|
||||||
private _terminal: ITerminal;
|
|
||||||
private _audioContext: AudioContext;
|
private _audioContext: AudioContext;
|
||||||
|
|
||||||
constructor(_terminal: ITerminal) {
|
constructor(
|
||||||
this._terminal = _terminal;
|
private _terminal: ITerminal
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public playBellSound(): void {
|
public playBellSound(): void {
|
||||||
@@ -26,8 +26,8 @@ export class SoundManager implements ISoundManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._audioContext) {
|
if (this._audioContext) {
|
||||||
let bellAudioSource = this._audioContext.createBufferSource();
|
const bellAudioSource = this._audioContext.createBufferSource();
|
||||||
let context = this._audioContext;
|
const context = this._audioContext;
|
||||||
this._audioContext.decodeAudioData(this.base64ToArrayBuffer(this.removeMimeType(this._terminal.options.bellSound)), (buffer) => {
|
this._audioContext.decodeAudioData(this.base64ToArrayBuffer(this.removeMimeType(this._terminal.options.bellSound)), (buffer) => {
|
||||||
bellAudioSource.buffer = buffer;
|
bellAudioSource.buffer = buffer;
|
||||||
bellAudioSource.connect(context.destination);
|
bellAudioSource.connect(context.destination);
|
||||||
@@ -41,7 +41,7 @@ export class SoundManager implements ISoundManager {
|
|||||||
private base64ToArrayBuffer(base64: string): ArrayBuffer {
|
private base64ToArrayBuffer(base64: string): ArrayBuffer {
|
||||||
const binaryString = window.atob(base64);
|
const binaryString = window.atob(base64);
|
||||||
const len = binaryString.length;
|
const len = binaryString.length;
|
||||||
let bytes = new Uint8Array(len);
|
const bytes = new Uint8Array(len);
|
||||||
|
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
bytes[i] = binaryString.charCodeAt(i);
|
bytes[i] = binaryString.charCodeAt(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user