Socket
Book a DemoInstallSign in
Socket

@caleblawson/voice-gladia

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@caleblawson/voice-gladia

Mastra Gladia AI voice integration

latest
npmnpm
Version
0.10.1
Version published
Maintainers
1
Created
Source

@mastra/voice-gladia

Gladia AI Voice integration for Mastra, providing Speech-to-text (STT) capabilities using Gladia's voice technology.

Installation

npm install @mastra/voice-gladia

Configuration

The module requires the following environment variable:

GLADIA_API_KEY=your_api_key

Usage

import { GladiaVoice } from '@mastra/voice-gladia';
import { createReadStream } from 'fs';
import path from 'path';

const voice = new GladiaVoice({
  listeningModel: {
    apiKey: process.env.GLADIA_API_KEY!,
  },
});

// Create an agent with voice capabilities
// Note: Gladia only supports STT, so the agent will only be able to listen.
export const agent = new Agent({
  name: 'Agent',
  instructions: `You are a helpful assistant with STT capabilities.`,
  model: google('gemini-1.5-pro-latest'),
  voice: voice,
});

// Example usage with a local audio file
const audioStream = createReadStream(path.join(process.cwd(), 'audio.m4a'));

try {
  const text = await voice.listen(audioStream, {
    fileName: 'audio.m4a',
    mimeType: 'audio/mp4',
  });
  console.log('Transcription:', text);
} catch (error) {
  console.error('Error transcribing audio:', error);
}

Features

  • High-quality Speech-to-Text recognition
  • Support for various audio formats
  • Advanced diarization and translation options
  • Easy integration with Mastra agents

Limitations

  • Only supports Speech-to-Text (STT) functionality. Text-to-Speech (TTS) is not supported.

Available Voices

Gladia does not expose a list of available "voices" in the traditional sense. The service focuses on providing high-quality transcription across various languages and audio characteristics.

Languages

Gladia supports a wide range of languages. For a complete list, please refer to the Gladia documentation.

Keywords

mastra

FAQs

Package last updated on 24 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts