Fish Audio Plugin
A high-quality Text-to-Speech (TTS) and Speech-to-Text (STT) plugin for Vision Agents that uses the Fish Audio API.
Installation
uv add "vision-agents[fish]"
# or directly
uv add vision-agents-plugins-fish
Usage
Text-to-Speech (TTS)
from vision_agents.plugins.fish import TTS
from getstream.video.rtc.audio_track import AudioStreamTrack
# Initialize with API key from environment variable
tts = TTS()
# Or specify API key directly
tts = TTS(api_key="your_fish_audio_api_key")
# Create an audio track to output speech
track = AudioStreamTrack(framerate=16000)
tts.set_output_track(track)
# Register event handlers
@tts.events.subscribe
async def on_audio(event):
print(f"Received audio chunk: {len(event.audio_data)} bytes")
# Send text to be converted to speech
async for chunk in tts.send_iter("Hello, this is a test of the Fish Audio text-to-speech plugin."):
pass
Speech-to-Text (STT)
from vision_agents.plugins.fish import STT
from getstream.video.rtc.track_util import PcmData
# Initialize with API key from environment variable
stt = STT()
# Or specify API key directly and language
stt = STT(api_key="your_fish_audio_api_key", language="en")
# Register event handlers
@stt.events.subscribe
async def on_transcript(event):
print(f"Transcript: {event.text}")
# Process audio data
pcm_data = PcmData(samples=audio_samples, sample_rate=16000)
await stt.process_audio(pcm_data)
Configuration Options
TTS Options
api_key: Fish Audio API key (default: reads fromFISH_API_KEYenvironment variable)reference_id: Optional reference voice ID to use for synthesisbase_url: Optional custom API endpoint (default: uses Fish Audio's default endpoint)client: Optionally pass in your own instance of the Fish Audio Session
STT Options
api_key: Fish Audio API key (default: reads fromFISH_API_KEYenvironment variable)language: Language code for transcription (e.g., "en", "zh"). If None, automatic language detection will be usedignore_timestamps: Skip timestamp processing for faster results (default: False)sample_rate: Sample rate of the audio in Hz (default: 16000)base_url: Optional custom API endpointclient: Optionally pass in your own instance of the Fish Audio Session
Reference Audio
Fish Audio supports using reference audio for voice cloning:
from vision_agents.plugins.fish import TTS
# Using a reference voice ID
tts = TTS(reference_id="your_reference_voice_id")
# Or pass reference audio dynamically when sending text
# (See Fish Audio SDK documentation for advanced usage)
Supported Languages (STT)
Fish Audio STT supports multiple languages with automatic detection. Common language codes include:
en- Englishzh- Chinesees- Spanishfr- Frenchde- Germanja- Japaneseko- Koreanpt- Portuguese
For automatic language detection, set language=None (default).
Supported Audio Formats (STT)
The STT implementation accepts PCM audio data and converts it to WAV format internally. Supported configurations:
- Maximum audio size: 100MB
- Maximum duration: 60 minutes
- Sample rate: 16kHz or higher recommended
- Format: Mono, 16-bit PCM
Requirements
- Python 3.10+
- fish-audio-sdk>=2025.4.2
Getting Your API Key
- Sign up for a Fish Audio account at https://fish.audio
- Navigate to the API Keys section in your dashboard
- Create a new API key
- Set the
FISH_API_KEYenvironment variable or pass it directly to the plugin
Metadata
Release files for vision-agents-plugins-fish 0.6.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vision_agents_plugins_fish-0.6.9.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vision_agents_plugins_fish-0.6.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / vision_agents_plugins_fish-0.6.9.tar.gz
| Download URL | vision_agents_plugins_fish-0.6.9.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cd3564a7b80f8c67ee8dcca96a816702a35892d155b837f790acb2616e59cc6
|
|
BLAKE2b-256 checksum How to use checksums |
d743a713aa3ac56ab1ba4ef11101cadf5ec4d2ec86fa8f4d6711d3ae5639a647
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / vision_agents_plugins_fish-0.6.9-py3-none-any.whl
| Download URL | vision_agents_plugins_fish-0.6.9-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e4784b067a8699e018326bb7e6f41f9d01f22850f5de030f3852708f1755d76
|
|
BLAKE2b-256 checksum How to use checksums |
731ea6f03cf3d4a5d67ecc2f891e332171b5b34f908a7371c1845c18371c4da5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|