sharyx_voice_sdk 0.0.1
sharyx_voice_sdk: ^0.0.1 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",
);
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),
),
);
}
}