Skip to main content

a single interface around speech-to-speech foundation models

Project description

              .... .- .. --.. . .-.. .- -... ...       ✨🎤 pip install spoken 🎤✨       .. - .----. ... / .- / -... .- -.. / -.. .- -.--


spoken provides a single abstraction for a variety of audio foundation models. It is primarily designed for large-scale evaluation/benchmarking of realtime speech-to-speech models, but it can also be used as a drop-in inference library.

# os.environ['LOG_LEVEL'] = 'DEBUG' # detailed client/server state management logging
import spoken

model = spoken("gpt-4o-realtime-preview-2024-12-17", "examples/scooby.wav")
input_asr, output_asr, output_audio = await model.run()

output_asr                   # "That's quite the story..."
len(output_audio)            # 8549ms
model.output_audio_tokens    # 254

Large audio models operate on audio tokens rather than transcribed text. This enables low-latency streaming conversational audio agents that directly generate audio end-to-end. Although promising and exciting, using these models requires non-trivial configuration and state management, due to major providers differing significantly in interface.

(AFAWK,) spoken supports all provider speech-to-speech models.

  • OpenAI Realtime
    • gpt-4o-realtime-preview-2024-12-17
    • gpt-4o-mini-audio-preview-2024-12-17 [coming soon, not part of realtime API]
  • Gemini Multimodal Live
    • gemini-2.5-flash-preview-native-audio-dialog
    • gemini-2.5-flash-exp-native-audio-thinking-dialog
  • Amazon Nova Sonic (pip install spoken[nova])
    • amazon.nova-sonic-v1:0

Examples

Installation

  • Simply run pip install spoken
    • Python 3.12+ required + pip install spoken[nova] + portaudio.h (+ OS X: brew install portaudio) for Amazon Nova Sonic support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spoken-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spoken-0.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file spoken-0.1.1.tar.gz.

File metadata

  • Download URL: spoken-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for spoken-0.1.1.tar.gz
Algorithm Hash digest
SHA256 484436723f877c67e3f5b29cd5abc9f90d8907788383f9845f808387eb76c618
MD5 90120e9e50041bb7dc0b35e655f3ff16
BLAKE2b-256 21582571e4f919d23f6649958d378c8d95d01ab2b76a3d224eedbeeb51fd6b23

See more details on using hashes here.

File details

Details for the file spoken-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spoken-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for spoken-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f101603c3ce9b8d22ca1aa566c02a347703e603d85b85c270ac9141be0f30e2
MD5 4dab0393c8ed829193aa692bf5462f74
BLAKE2b-256 498699e2a8cf9c4f711bdc3c78d8df721f6602cc690d79d516eed764f6790453

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page