flutter_ai_voice 0.1.2 copy "flutter_ai_voice: ^0.1.2" to clipboard
flutter_ai_voice: ^0.1.2 copied to clipboard

Speech-to-text contracts and models for flutter_ai: a batch-first SpeechToText interface, transcript models, and a callback adapter. Concrete engines (Whisper and friends) plug in behind the interface.

example/flutter_ai_voice_example.dart

// Adapts a (fake) transcription engine and transcribes a buffer.
//
// Run with: dart run example/flutter_ai_voice_example.dart
import 'dart:typed_data';

import 'package:flutter_ai_voice/flutter_ai_voice.dart';

Future<void> main() async {
  // A real app would call an on-device Whisper binding or a cloud API here.
  final stt = CallbackSpeechToText(
    transcribe: (audio, {mediaType, language}) async => Transcript(
      text: 'pretend transcription of ${audio.length} bytes',
    ),
  );

  final recorded = Uint8List.fromList(List<int>.filled(1024, 0));
  final transcript =
      await stt.transcribeBytes(recorded, mediaType: 'audio/wav');

  // Feed transcript.text into a UseChatController in a real app.
  print(transcript.text);
}
0
likes
0
points
45
downloads

Publisher

verified publishermouazanan.dev

Weekly Downloads

Speech-to-text contracts and models for flutter_ai: a batch-first SpeechToText interface, transcript models, and a callback adapter. Concrete engines (Whisper and friends) plug in behind the interface.

Homepage
Repository (GitHub)
View/report issues

Topics

#ai #speech-to-text #voice #transcription #flutter

License

unknown (license)

More

Packages that depend on flutter_ai_voice