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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ziextractor

v2.1.2

Published

Extractor using cobalt tools and youtube-sr for discord-player v6

Downloads

634

Readme

ZiExtractor:

About

ZiExtractor is a personal music extractor built for extracting audio from various sources. It's currently under development and might not be entirely stable. Please use it with caution.
ZiExtractor draws inspiration from the @discord-player/extractor, providing a foundation for audio extraction.

Getting Started

Installation ZiExtractor

npm i ziextractor

Integration

  1. Locate the main file where you initialize your discord-player (e.g., index.js).
  2. Import ZiExtractor from the ziextractor package:
const { ZiExtractor } = require('ziextractor');
  1. Register ZiExtractor with your player:
player.extractors.register(ZiExtractor, {});
  1. Disable youtube
player.extractors.loadDefault(ext => ext !== 'YouTubeExtractor');

Important Notes

  • Exercise caution while using ZiExtractor as it's still under development.
  • Ensure you have the necessary permissions to extract audio from the intended sources.


ZiVoiceExtractor:

About

ZiVoiceExtractor is a powerful voice extraction and speech recognition tool designed for use with Discord bots. It allows you to capture voice input from users in voice channels and convert it to text using Google's Speech-to-Text API.

Getting Started

Initializing ZiVoiceExtractor

First, import the necessary components:

const { ZiVoiceExtractor, useZiVoiceExtractor } = require('zivoiceextractor');

Then, initialize the extractor with your Discord player instance and speech options:

const speechOptions = {
  ignoreBots: true,
  minimalVoiceMessageDuration: 1,
  lang: 'en-US', // Set your preferred language
  key: 'YOUR_GOOGLE_SPEECH_API_KEY', // Optional: Provide your own API key
  profanityFilter: false, // Optional: Enable/disable profanity filter
};
const voiceExtractor = useZiVoiceExtractor(speechOptions);

Handling Voice Input

To start processing voice input, you need to call the handleSpeakingEvent method when a user joins a voice channel:

which discord-player:

player.events.on('connection', async queue => {
  const { player, connection } = queue;
  const ziVoice = useZiVoiceExtractor();

  ziVoice.handleSpeakingEvent(player.client, connection);
});

which discord: joinVoiceChannel command:

const voiceChannel = interaction.member?.voice.channel;
if (voiceChannel) {
  joinVoiceChannel({
    channelId: voiceChannel.id,
    guildId: voiceChannel.guild.id,
    adapterCreator: voiceChannel.guild.voiceAdapterCreator,
    selfDeaf: false,
  });
}

voiceStateUpdate:

client.on('voiceStateUpdate', (oldState, newState) => {
  if (newState.channel && newState.channel.type === 'voice') {
    const ziVoice = useZiVoiceExtractor();
    ziVoice.handleSpeakingEvent(client, newState);
  }
});

Handling Voice Output

To handle voice output, you can listen for the 'voiceCreate' event:

voiceExtractor.on('voiceCreate', async ({ content, user, channel, client }) => {
  console.log(`User ${user.username} said: ${content}`);
  // Handle the recognized speech here
});

Debugging

ZiVoiceExtractor provides debug information. You can listen to the 'debug' event for detailed logs:

voiceExtractor.on('debug', message => {
  console.log(`[ZiVoiceExtractor Debug] ${message}`);
});

Configuration Options

When initializing ZiVoiceExtractor, you can provide the following options:

  • ignoreBots: (boolean) Whether to ignore voice input from bots.
  • minimalVoiceMessageDuration: (number) Minimum duration of voice input to process (in seconds).
  • focusUser: (string) The user ID to focus on.
  • lang: (string) The language code for speech recognition (e.g., 'en-US', 'fr-FR').
  • key: (string) Your Google Speech API key (optional).
  • profanityFilter: (boolean) Whether to enable the profanity filter.

Notes

  • Ensure you have the necessary permissions to use voice features in your Discord bot.
  • The Google Speech API key is optional but recommended for production use to avoid rate limiting.
  • This extractor works best with clear audio input and may have difficulty with background noise or low-quality microphones.

Support

For issues, feature requests, or contributions, please visit the GitHub repository. Discord