Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Latest commit

 

History

History
50 lines (33 loc) · 1.6 KB

File metadata and controls

50 lines (33 loc) · 1.6 KB

Speechly Client Library for Unity and C#

Speechly is an API for building voice features into games, XR, applications and web sites. SpeechlyClient streams audio from a Unity or .NET app to Speechly cloud API (or on-device) and provides a C# API for receiving real-time speech-to-text transcription and natural language understanding results.

API Documentation

GitHub

Usage


using Speechly.SLUClient;
using Speechly.Tools;
using Speechly.Types;

...

var client = new SpeechlyClient(
  debug: true
);

client.OnSegmentChange = (segment) => {
  Logger.Log(segment.ToString());
};

var decoder = new CloudDecoder(
  appId: "MY_APP_ID_FROM_SPEECHLY_DASHBOARD",
  deviceId: Platform.GetDeviceId()
);

await client.Initialize(decoder);

await client.Start();
client.ProcessAudioFile(fileName);  // Raw 16bit mono 16kHz
// Alternatively use client.ProcessAudio(floats) to process audio samples from e.g. microphone
await client.Stop();

await client.Shutdown();

Learn more