Skip to main content

speech_edge 0.1.0 copy "speech_edge: ^0.1.0" to clipboard
speech_edge: ^0.1.0 copied to clipboard

Low latency cross-platform audio capture and PCM/WebSocket streaming SDK for Flutter.

SpeechEdge #

Low latency cross-platform audio capture SDK for Flutter with:

  • Microphone capture abstraction
  • Echo cancellation / noise suppression / auto gain flags
  • PCM16 little-endian chunking
  • Real-time WebSocket streaming

Current status #

This repo now contains:

  • A reusable SDK API in lib/speech_edge.dart
  • A runnable demo app in lib/main.dart

The SDK uses the record plugin for cross-platform capture and web_socket_channel for transport.

Install #

dependencies:
  speech_edge:
    path: .

Usage #

import 'package:speech_edge/speech_edge.dart';

final client = SpeechEdgeClient(
  config: const SpeechEdgeConfig(
    sampleRate: 16000,
    channels: 1,
    chunkSizeBytes: 3200,
    echoCancellation: true,
    noiseSuppression: true,
    autoGainControl: true,
    payloadMode: SpeechEdgePayloadMode.rawPcm16leBinary,
  ),
);

await client.connectWebSocket(Uri.parse('ws://localhost:8080/stream'));
await client.startCapture();

client.chunks.listen((chunk) {
  // local access to PCM bytes
  print('chunk ${chunk.sequence} => ${chunk.pcm16le.length} bytes');
});

Platform setup #

  • Android: RECORD_AUDIO permission is required and already added.
  • iOS/macOS: microphone usage descriptions are required and already added.
  • macOS sandbox: audio input + network client entitlements are required and already added.
  • Web: browser mic permission and secure context (HTTPS or localhost) are required.

Notes #

  • DSP controls (echoCancellation, noiseSuppression, autoGainControl) are best-effort and depend on OS/device support.
  • Payload can be raw PCM binary frames or JSON with base64 payload.
0
likes
120
points
13
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Low latency cross-platform audio capture and PCM/WebSocket streaming SDK for Flutter.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, record, web_socket_channel

More

Packages that depend on speech_edge