npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-audio

v0.3.1

Published

OpenCode plugin for AI audio generation — music (Suno) and TTS (ElevenLabs, Fish Audio)

Readme

opencode-audio

An OpenCode plugin that adds AI audio generation tools — music via Suno and text-to-speech via ElevenLabs and Fish Audio.

Tools

| Tool | Description | |------|-------------| | generate_music | Generate AI music with Suno (async polling, saves .mp3) | | download_music | Download previously generated Suno music by task ID | | generate_voice_elevenlabs | Text-to-speech with ElevenLabs (multilingual) | | list_elevenlabs_voices | Browse available ElevenLabs voices | | generate_voice_fish | Text-to-speech with Fish Audio (best for Chinese) | | list_fish_voices | Browse available Fish Audio voice models |

Install

npm install opencode-audio

Add to your opencode.json:

{
  "plugins": {
    "audio": "opencode-audio"
  }
}

Local development

Clone this repo into your project and point to it:

{
  "plugins": {
    "audio": "./path/to/opencode-audio"
  }
}

Configuration

Set API keys as environment variables (e.g. in .env):

# Music generation (Suno)
SUNO_API_KEY=your-key-here        # https://sunoapi.org

# Voice generation (use one or both)
ELEVENLABS_API_KEY=your-key-here  # https://elevenlabs.io
FISH_API_KEY=your-key-here        # https://fish.audio

Each tool requires its corresponding API key to be set as an environment variable. Keys are read once when the plugin loads.

Usage

Once installed, the tools are available to the AI assistant automatically.

Generate music

Generate epic orchestral background music, save to assets/audio/

The generate_music tool accepts:

| Parameter | Required | Description | |-----------|----------|-------------| | track_id | Yes | Output filename (without extension) | | prompt | Yes | Text description of the music | | style | Yes | Genre/style tags (e.g. "epic orchestral, cinematic, 90 bpm") | | output_dir | No | Output directory relative to project root | | instrumental | No | Instrumental only, no vocals (default: true) | | model | No | Suno model: "V4", "V4_5", "V4_5PLUS", "V4_5ALL", "V5" (default: "V4_5ALL") |

Download music

Download the music from task abc123, save to assets/audio/

Use download_music to retrieve tracks from a previous generate_music call — especially useful if the original request timed out. Suno generates 2 tracks per request.

| Parameter | Required | Description | |-----------|----------|-------------| | task_id | Yes | Task ID returned from a previous generate_music call | | filename | Yes | Output filename (without extension) | | output_dir | No | Output directory relative to project root | | track_index | No | Which track to download, 0 or 1 (default: 0) |

Text-to-speech (ElevenLabs)

List available voices, then generate "Welcome aboard" with a deep male voice

| Parameter | Required | Description | |-----------|----------|-------------| | text | Yes | Text to convert to speech | | voice_id | Yes | ElevenLabs voice ID (find via list_elevenlabs_voices) | | filename | Yes | Output filename (without extension) | | output_dir | No | Output directory relative to project root | | model_id | No | TTS model (default: "eleven_multilingual_v2") | | stability | No | Voice stability 0.0–1.0 (default: 0.5) | | similarity_boost | No | Similarity boost 0.0–1.0 (default: 0.75) | | style | No | Style exaggeration 0.0–1.0 (default: 0.4) | | format | No | "mp3_44100_128", "opus", "pcm_44100" (default: "mp3_44100_128") |

Text-to-speech (Fish Audio)

Generate Chinese speech "你好世界" using Fish Audio

| Parameter | Required | Description | |-----------|----------|-------------| | text | Yes | Text to convert to speech | | reference_id | Yes | Fish Audio voice model ID (find via list_fish_voices) | | filename | Yes | Output filename (without extension) | | output_dir | No | Output directory relative to project root | | format | No | "mp3", "wav", "opus" (default: "mp3") | | bitrate | No | Audio bitrate in kbps (default: 128) |

Development

npm install
npm run typecheck   # Type-check without emitting
npm run build       # Compile to dist/

License

MIT