kletso_voice 0.1.1 copy "kletso_voice: ^0.1.1" to clipboard
kletso_voice: ^0.1.1 copied to clipboard

Microphone and speaker for Kletso voice sessions: PCM capture on mobile, desktop and web (Wasm-safe) plus low-latency playback, installed in one line.

example/kletso_voice_example.dart

// Add microphone and speaker to a Kletso client in one line. In a real app use
// your publishable key; the fake backend here only shows the wiring.
import 'dart:io';

import 'package:kletso_core/fake.dart';
import 'package:kletso_core/kletso_core.dart';
import 'package:kletso_voice/kletso_voice.dart';

Future<void> main() async {
  final backend = KletsoFakeBackend(scenario: const KletsoFakeScenario.demo());
  final client = await Kletso.init(
    KletsoConfig(publishableKey: 'kl_pub_dev_example', agentId: 'agt_demo'),
    api: backend,
    transport: backend,
  );

  // Capture (record_* / Web Audio) and playback (audio_stream_player) for client.voice.
  final audio = KletsoVoice.install(client);
  stdout.writeln('voice audio installed: $audio');

  // From here the chat widgets show a mic button when the agent has voice
  // enabled; or drive the controller yourself:
  //   await client.voice.start();   // asks for the microphone on first use
  //   await client.voice.stop();
  await client.dispose();
}
0
likes
160
points
162
downloads

Documentation

API reference

Publisher

verified publisherkletso.ai

Weekly Downloads

Microphone and speaker for Kletso voice sessions: PCM capture on mobile, desktop and web (Wasm-safe) plus low-latency playback, installed in one line.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #voice #speech #chatbot #sdk

License

MIT (license)

Dependencies

audio_stream_player, flutter, kletso_core, record_android, record_ios, record_linux, record_macos, record_platform_interface, record_windows, web

More

Packages that depend on kletso_voice