sharyx_voice_sdk 0.0.2 copy "sharyx_voice_sdk: ^0.0.2" to clipboard
sharyx_voice_sdk: ^0.0.2 copied to clipboard

Voice assistant SDK for Flutter using Deepgram STT and ElevenLabs TTS.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:sharyx_voice_sdk/sharyx_voice_sdk.dart';

void main() {

  // SDK initialization (developer will do this)
  SharyxVoiceSDK.initialize(
    deepgramApiKey:"9d0084d1288e9b5cfc8d02e81b970cae837d4226",
    elevenLabsApiKey: "sk_ec0aeb2a70e3033f03b756f83ef351c7f071c5d28eab4b62",
    elevenVoice: "Xb7hH8MSUJpSbSDYk0k2",
    openAiApiKey:"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"
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: VoiceChatScreen(),
    );
  }
}

class VoiceChatScreen extends StatelessWidget {
  const VoiceChatScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Sharyx Voice SDK")),
      body: const VoiceChatWidget(),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          SharyxVoiceSDK.start(); // start listening
        },
        child: const Icon(Icons.mic),
      ),
    );
  }
}