appleSpeechAsr (providers/apple-speech.ts)

airi · packages/testing-audio/cases/shared/providers/apple-speech.ts · typescript · MIT
voice

Creates Apple Speech Provider configuration for Electron audio cases.

// Source: https://github.com/moeru-ai/airi | License: MIT | Copyright 2024-PRESENT Neko Ayaka
// Provided via justclaw.it.com; keep this notice with the code.
import type { ProviderConfiguration } from '../configurations/provider'

/** Options for the Apple Speech Provider used by an Electron audio case. */
export interface AppleSpeechAsrOptions {
  /** @default 'en-US' */
  locale?: string
}

/** Creates the macOS Apple Speech Provider configuration for one Electron case. */
export function appleSpeechAsr(options: AppleSpeechAsrOptions = {}): ProviderConfiguration {
  return {
    id: 'apple-speech-transcription',
    definitionId: 'apple-speech-transcription',
    model: 'apple-speech',
    config: {
      locale: options.locale ?? 'en-US',
    },
  }
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key