Speechmatics.Transcribe 2.0.0

dotnet add package Speechmatics.Transcribe --version 2.0.0
                    
NuGet\Install-Package Speechmatics.Transcribe -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Speechmatics.Transcribe" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Speechmatics.Transcribe" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Speechmatics.Transcribe" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Speechmatics.Transcribe --version 2.0.0
                    
#r "nuget: Speechmatics.Transcribe, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Speechmatics.Transcribe@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Speechmatics.Transcribe&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Speechmatics.Transcribe&version=2.0.0
                    
Install as a Cake Tool

Speechmatics.Transcribe - the C# library for the Speechmatics ASR REST API

The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job types are transcription of audio files, and alignment of audio files with existing transcripts to add word or line timings.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Speechmatics.Transcribe.Api;
using Speechmatics.Transcribe.Client;
using Speechmatics.Transcribe.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Speechmatics.Transcribe.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.IO;
using Speechmatics.Transcribe.Api;
using Speechmatics.Transcribe.Client;

namespace SwaggerDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var c = new Configuration();
            c.AddDefaultHeader("Authorization", "Bearer -");
            c.BasePath = "https://asr.api.speechmatics.com/v2";

            var api = new DefaultApi(c);
            var jobId = "";

            using (var s = File.OpenRead(@"short_text.wav"))
            {
                var answer = api.JobsPost("{\"type\":\"transcription\", \"transcription_config\":{\"language\":\"en\"}}", s);
                Console.WriteLine($"Job created with id {answer.Id}");
                jobId = answer.Id;
            }

            var job = api.JobsJobidGet(jobId);
            Console.WriteLine(job);

            Console.ReadLine();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost/v2

Class Method HTTP request Description
DefaultApi JobidAlignmentGet GET /{jobid}/alignment Get the aligned text file for an alignment job.
DefaultApi JobsGet GET /jobs List all jobs.
DefaultApi JobsJobidDataGet GET /jobs/{jobid}/data Get the data file used as input to a job.
DefaultApi JobsJobidDelete DELETE /jobs/{jobid} Delete a job and remove all associated resources.
DefaultApi JobsJobidGet GET /jobs/{jobid} Get job details, including progress and any error reports.
DefaultApi JobsJobidTextGet GET /jobs/{jobid}/text Get the text file used as input to an alignment job.
DefaultApi JobsJobidTranscriptGet GET /jobs/{jobid}/transcript Get the transcript for a transcription job.
DefaultApi JobsPost POST /jobs Create a new job.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 428 2/17/2023
1.0.0 925 9/20/2019