Skip to content

Commit

Permalink
Add RealtimeTranscriber.ConfigureEndUtteranceThreshold and ForceEndUt…
Browse files Browse the repository at this point in the history
…terance
  • Loading branch information
Swimburger committed Aug 2, 2024
1 parent e768358 commit 11891f2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/AssemblyAI/AssemblyAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
<RootNamespace>AssemblyAI</RootNamespace>
<AssemblyName>AssemblyAI</AssemblyName>
<PackageId>AssemblyAI</PackageId>
<Version>1.0.0-beta1</Version>
<Version>1.0.0-beta2</Version>
<Title>AssemblyAI C# .NET SDK</Title>
<Authors>AssemblyAI</Authors>
<Description>The AssemblyAI C# .NET SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, audio intelligence models, as well as the latest LeMUR models.</Description>
<Copyright>Copyright 2024 (c) AssemblyAI, Inc. All rights reserved.</Copyright>
<PackageTags>ASR;Speech-To-Text;STT;Speech;AI;AssemblyAI</PackageTags>
<Company>AssemblyAI</Company>
<Product>AssemblyAI</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<PackageVersion>1.0.0-beta1</PackageVersion>
<AssemblyVersion>1.0.0.1</AssemblyVersion>
<FileVersion>1.0.0.1</FileVersion>
<PackageVersion>1.0.0-beta2</PackageVersion>
<OutputType>Library</OutputType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/AssemblyAI/assemblyai-csharp-sdk</PackageProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/AssemblyAI/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace AssemblyAI.Core;

internal static class Constants
{
internal const string Version = "1.0.0-beta1";
internal const string Version = "1.0.0-beta2";
public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK";
}
20 changes: 20 additions & 0 deletions src/AssemblyAI/Realtime/RealtimeTranscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,26 @@ public void SendAudio(byte[] audio)

_socket!.Send(audio);
}

/// <summary>
/// Manually end an utterance
/// </summary>
public void ForceEndUtterance()
{
_socket!.Send("{\"force_end_utterance\":true}");
}

/// <summary>
/// Configure the threshold for how long to wait before ending an utterance. Default is 700ms.
/// </summary>
/// <param name="threshold">
/// The duration of the end utterance silence threshold in milliseconds.
/// This value must be an integer between 0 and 20_000.
/// </param>
public void ConfigureEndUtteranceThreshold(uint threshold)
{
_socket!.Send($"{{\"end_utterance_silence_threshold\":{threshold}}}");
}

/// <summary>
/// Terminates the real-time transcription session, closes the connection, and disposes the real-time transcriber.
Expand Down

0 comments on commit 11891f2

Please sign in to comment.