Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
/ io-speaker Public archive

Plugin for io for common messages for speaker-worker

License

Notifications You must be signed in to change notification settings

cislrpi/io-speaker

Repository files navigation

Note: This repo has been merged into larger the @cisl/io monorepo.

@cisl/io-speaker

Plugin for @cisl/io for interfacing with the speaker-worker

Installation

npm install @cisl/io-speaker

Usage

const io = require('@cisl/io')();
require('@cisl/io-speaker');

io.speaker.speak('test');
import  cislio from '@cisl/io';
import '@cisl/io-speaker';

const io = cislio();
io.speaker.speak("test");

API

speak

  • speak(text: string, options: {duration?: number, voice?: string} = {}): Promise<RabbitMessage>
  • clearCache(): void
  • changeVolume(change: number): void
  • increaseVolume(change: number = 20): void
  • reduceVolume(change: number = 20): void
  • stop(): Promise<RabbitMessage>
  • beginSpeak(msg: Record<string, unknown>): void
  • endSpeak(msg: Record<string, unknown>): void
  • onBeginSpeak(handler: SpeakSubscriptionCallback): void
  • onEndSpeak(handler: SpeakSubscriptionCallback): void