Transcribe a recording to JSON with the OneSpeech .NET tool; first use downloads models.
dotnet tool install --global RecursiveAI.OneSpeech.CliThe CLI includes RecursiveAI.OneSpeech, whose OneAudio dependency decodes audio; no separate OneAudio install is needed.
Requires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
Use your own audio file, or the optional zip’s sample.flac. The zip’s dotnet run launcher is optional; the installed onespeech command works directly.
onespeech transcribe sample.flac --language en --model moonshine-ai/moonshine-tiny --format json --output transcript.jsonUnzip the example, then dotnet run.
Writes transcript.json. The recognized text is “Duff it into you, his belly counseled him.”
“Duff” is a recognition error: the recording says “stuff”.
On an empty cache, this English run acquires about 1.98 GB of publisher files for Moonshine tiny, Qwen3-ForcedAligner and CAM++ English, including configuration/tokenizer files in the pinned catalog. Converted runtime files require additional disk space; timing fallbacks can acquire more models.
Output formats are text, schema-v1 JSON, SRT and VTT. Audio inputs include WAV, MP3, FLAC, Ogg Vorbis/Opus, AAC-LC in M4A/3GP/ADTS, and AMR-NB/WB. The CLI also accepts MP4/MOV, Matroska/WebM, AVI, transport streams, ASF and FLV when their audio codec is supported; see audio input and containers.
The full program
sample.flac is the LibriSpeech test-clean clip 1089-134686-0001: “stuff it into you his belly counselled him”. It is included under CC BY 4.0, credited to Vassil Panayotov, Guoguo Chen, Daniel Povey and Sanjeev Khudanpur (source). The downloadable C# launcher installs a private copy of the published CLI, runs the command, and prints the saved JSON’s text field. It does not call the transcription API directly.
using System.Diagnostics; using System.Text.Json; void Run(string command, params string[] arguments) { var start = new ProcessStartInfo(command) { RedirectStandardOutput = true }; foreach (var argument in arguments) start.ArgumentList.Add(argument); using var process = Process.Start(start)!; string output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); if (process.ExitCode != 0) throw new Exception(output); } if (!Directory.Exists("tools")) Run("dotnet", "tool", "install", "RecursiveAI.OneSpeech.Cli", "--version", "1.1.0", "--tool-path", "tools"); Run(Path.GetFullPath(Path.Combine("tools", OperatingSystem.IsWindows() ? "onespeech.exe" : "onespeech")), "transcribe", "sample.flac", "--language", "en", "--model", "moonshine-ai/moonshine-tiny", "--format", "json", "--output", "transcript.json"); using var json = JsonDocument.Parse(File.ReadAllText("transcript.json")); Console.WriteLine("Wrote transcript.json"); Console.WriteLine(json.RootElement.GetProperty("transcript").GetProperty("text").GetString());
dotnet run prints:
Wrote transcript.json Duff it into you, his belly counseled him.
“Duff” is a recognition error for “stuff”.
The tool exits with 1 for model/audio/I/O failures, 2 for usage errors and 130 for cancellation; typed errors go to stderr.
Variations
Write plain text instead of JSON:
onespeech transcribe sample.flac --language en --model moonshine-ai/moonshine-tiny --format textDuff it into you, his belly counseled him.Related recipes
The short answer
Install the published RecursiveAI.OneSpeech.Cli .NET tool, then run onespeech transcribe with an audio filename, language, model and output format. --output transcript.json writes UTF-8 JSON instead of sending the transcript to stdout.
transcript.json retains timing and speaker metadata in addition to recognized text.
How do I transcribe audio on my computer?
Install .NET 10, install the tool, and run the command from the directory containing your recording. With a global tool installation, the .NET tools directory must be on your shell’s PATH. onespeech --help lists commands and options. The downloadable launcher avoids a global installation by placing the executable in a local tools folder.
The tool accepts standalone audio and supported media containers. Set --language to the language you intend to recognize and --model to a catalog recognizer ID. Model IDs are roles, not filenames: passing a diarization model as a recognizer is not a way to enable speaker-aware transcription.
Inference is local, but a first run may need downloads and conversion. The named recognizer is not necessarily the complete dependency set: transcription can also need alignment and speaker-grouping models. Pre-fetch the required roles before moving to a disconnected host. onespeech models list works offline, and models pull fetches a pinned model. See Command line and model packages.
How can I generate a transcript from audio?
Choose the output that your next step needs. Text is useful for reading or piping into another command. JSON retains the structured transcript. SRT and VTT are subtitle formats; the CLI supports them through the same --format option. --output selects a file rather than stdout, so scripts do not need to capture progress messages along with transcript content.
Review recognized words before using them where wording matters. If you already have the correct words and want timing rather than recognition, the separate align command reads a UTF-8 transcript file.
Is there a way to automatically transcribe audio to text?
Yes. Put the transcription command in your script and check its exit status before reading the output file. Success is exit code 0. Model, audio and I/O failures use 1; usage errors use 2; cancellation uses 130. Errors print a typed name and message to stderr, and inference does not write logs or progress to stdout. Ctrl+C reaches the library’s cancellation points.
Do not treat a stale output file as the result of a failed command. A batch script should only consume a file after a successful invocation and should use distinct filenames for distinct inputs.