conreality_headset 0.2.0 conreality_headset: ^0.2.0 copied to clipboard
Headset audio and text-to-speech support for Conreality live-action games.
conreality_headset #
Headset audio and text-to-speech support for Conreality live-action games.
Compatibility #
Android (5.0+). (iOS support is planned.)
Features #
-
Determines whether a wired or wireless headset is currently connected.
-
Provides headset events including connect/disconnect status notifications.
-
Supports speech synthesis (text-to-speech) when a headset is connected.
Supported devices #
-
Bluetooth headsets supporting the Headset Profile (HSP) and/or Hands-Free Profile (HFP)
-
Wired headphones connected to the headphone jack
Examples #
Importing the package #
import 'package:conreality_headset/conreality_headset.dart';
Checking for a headset #
var ok = await Headset.isConnected;
print("Headset is " + (ok ? "connected" : "NOT connected"));
Subscribing to headset events #
Stream<HeadsetEvent> stream = await Headset.subscribe();
stream.listen((HeadsetEvent event) {
print(event);
});
Speaking into the headset #
await Headset.speak("Hello, world!");
Installation #
pubspec.yaml
using Pub #
dependencies:
# See: https://pub.dev/packages/conreality_headset
conreality_headset: ^0.2.0
pubspec.yaml
using Git #
dependencies:
# See: https://github.com/conreality/conreality-plugins/tree/master/conreality_headset
conreality_headset:
git:
url: https://github.com/conreality/conreality-plugins.git
path: conreality_headset
See Also #
Follow @ConrealityCode and @ConrealityGame on Twitter for project updates.