GibberLink Documentation

repository·main·Indexed 26 days ago

https://github.com/pennyroyaltea/gibberlink

A framework and API that enables AI agents to communicate using the ggwave data-over-sound protocol. It allows agents to switch from natural language to a high-efficiency 'robo-language' for Agent-to-Agent (A2A) communication, providing tools to encode strings into audio samples, decode audio streams, and manage audio recording and playback.

Tokens
978
Snippets
2
Records
9
Agent score
89%

What's inside GibberLink

  1. Overview of GibberLink

    main
    GibberLink is a system that enables AI agents to switch from natural language (e.g., English) to a more efficient data-over-sound protocol called ggwave when they identify the interlocutor as another AI. This allows for high-efficiency Agent-to-Agent (A2A) communication. The project provides an API that allows agents to utilize this protocol for communication.
  2. Listen to audio events via `audioMessageEmitter`

    main

    The audioMessageEmitter is an EventEmitter used to communicate recording states and received messages.

    Supported Events:

    • recordingStateChanged: Emits a boolean indicating if recording is active.
    • recordingMessage: Emits the decoded string message received from the audio stream (after stripping the sender's ID prefix).
    • recordingError: Emits an Error object if recording fails.
    • audioMessage: Emits the string message that was just sent via sendAudioMessage.
  3. Send an audio message with `sendAudioMessage()`

    main

    Encodes a string message into an audible GGWave signal and plays it through the AudioContext destination. The message is automatically prefixed with a unique myID to prevent self-echo interference.

    Parameters:

    • message (string): The text to encode.
    • fastest (boolean): If true, uses GGWAVE_PROTOCOL_AUDIBLE_FASTEST. If false (default), uses GGWAVE_PROTOCOL_AUDIBLE_FAST.

    Returns true if the message was successfully sent/played, otherwise false.

  4. Start and stop audio recording

    main

    Controls the audio recording process which listens for incoming GGWave encoded messages.

    • startRecording(): Requests microphone access via getUserMedia (with echo cancellation, auto gain control, and noise suppression disabled to ensure signal fidelity) and begins processing audio buffers to decode messages.
    • stopRecording(): Disconnects the recorder, stops all media stream tracks, and resets the recording state.

    Both functions emit events via audioMessageEmitter (see below).

  5. Reference the ggwave module API

    main

    The GGWaveModule interface defines the primary methods for interacting with the library.

    export interface GGWaveModule {
        getDefaultParameters(): GGWaveParameters;
        init(params: GGWaveParameters): GGWaveInstance;
        encode(instance: GGWaveInstance, message: string, protocol: number, volume: number): Int16Array;
        decode(instance: GGWaveInstance, samples: Int16Array): string | null;
        TxProtocolId: {
          GGWAVE_TX_PROTOCOL_AUDIBLE_FAST: number;
          [key: string]: number;
        };
    }