Overview of GibberLink
mainggwave 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.repository·main·Indexed 26 days ago
https://github.com/pennyroyaltea/gibberlinkA 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.
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.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.Initializes the global AudioContext and the GGWave engine. This must be called before attempting to record or send audio messages. You can optionally provide a custom AudioContext and MediaStream.
Returns true if both the context and GGWave are successfully initialized, otherwise false.
ggwave module provides tools for audio-based data transmission. You first import the default function, which returns a Promise that resolves to a GGWaveModule. Once initialized, you can use the module to encode strings into audio samples (Int16Array) or decode audio samples back into strings.Creates or retrieves a global AnalyserNode connected to the audio context. This can be used to drive audio visualizers.
Returns the AnalyserNode if created or existing, or null if the AudioContext has not been initialized.
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.
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).
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;
};
}The TxProtocolId object contains protocol identifiers used during the encode process to specify the transmission type.
TxProtocolId: {
GGWAVE_TX_PROTOCOL_AUDIBLE_FAST: number;
[key: string]: number;
};