Skip to content

BEEP \x07 ascii as a short tone: #147

@myonara

Description

@myonara

to react on the BEEP character of ANSI, use the following code:

  beep() {
    const audioContext = new AudioContext();
    const oscillator = audioContext.createOscillator();
    const gainNode = audioContext.createGain();
    
    oscillator.connect(gainNode);
    gainNode.connect(audioContext.destination);
    
    oscillator.frequency.value = 800; // Frequency in Hz
    gainNode.gain.value = 0.3; // Volume (0-1)
    
    oscillator.start();
    oscillator.stop(audioContext.currentTime + 0.1); // Duration 100ms
  }

and in processAnsi:

          case 7:
            this.beep();
            display = false;
            break;```

Metadata

Metadata

Assignees

No one assigned

    Labels

    qualifyIssues that need to be discussed further

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions