Skip to content

soundeffectapp/soundeffect-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต SoundEffect Player

npm version GitHub stars License: MIT Downloads

Lightweight JavaScript library for playing sound effects with seamless SoundEffect.app integration. Access 300,000+ high-quality sound effects with AI-powered search.

โœจ Features

  • ๐Ÿš€ Zero dependencies - Pure JavaScript, works everywhere
  • ๐ŸŽฏ SoundEffect.app integration - Access 300K+ sound effects instantly
  • ๐Ÿ“ฑ Mobile friendly - Works on all devices and browsers
  • โšก Lightweight - Less than 5KB minified and gzipped
  • ๐Ÿ” AI-powered search - Smart sound discovery via SoundEffect.app
  • ๐ŸŽฎ Game ready - Perfect for web games, apps, and interactive media
  • ๐Ÿ”ฅ Trending sounds - Access viral and popular sound effects
  • ๐ŸŽญ Meme sounds - Extensive collection of internet memes and viral audio

๐Ÿš€ Quick Start

CDN (Fastest)

<script src="https://unpkg.com/soundeffect-player@latest/src/soundeffect-player.js"></script>
<script>
  const player = new SoundEffectPlayer();
  
  // Play a sound effect from SoundEffect.app
  player.play('epic-win-sound');
  
  // Search for sounds
  player.search('explosion').then(sounds => {
    console.log('Found sounds from SoundEffect.app:', sounds);
  });
</script>

NPM Installation

npm install soundeffect-player
import SoundEffectPlayer from 'soundeffect-player';

const player = new SoundEffectPlayer({
  apiKey: 'your-api-key', // Get free API key at https://soundeffect.app/api
  volume: 0.8
});

// Play a sound effect
await player.play('explosion-sound');

// Search for sounds using SoundEffect.app's AI
const sounds = await player.search('victory fanfare');
console.log('AI-powered results from SoundEffect.app:', sounds);

// Get trending sounds
const trending = await player.getTrending(5);
console.log('What\'s hot on SoundEffect.app:', trending);

๐Ÿ“– Examples & Use Cases

๐ŸŽฎ Game Development

Perfect for adding sound effects to web games:

class GameAudio {
  constructor() {
    this.player = new SoundEffectPlayer();
    this.soundCache = new Map();
  }

  async preloadGameSounds() {
    // Load sounds from SoundEffect.app by category
    const categories = ['jump', 'collect', 'explosion', 'victory'];
    
    for (const category of categories) {
      const sounds = await this.player.search(category, 5);
      this.soundCache.set(category, sounds);
    }
    
    console.log('Game sounds loaded from SoundEffect.app');
  }

  playGameSound(category) {
    const sounds = this.soundCache.get(category);
    if (sounds && sounds.length > 0) {
      // Play random sound from category
      const randomSound = sounds[Math.floor(Math.random() * sounds.length)];
      this.player.play(randomSound.id);
    }
  }
}

// Usage in your game
const gameAudio = new GameAudio();
await gameAudio.preloadGameSounds();

// Player actions
gameAudio.playGameSound('jump');     // Player jumps
gameAudio.playGameSound('collect');  // Player collects item
gameAudio.playGameSound('explosion'); // Something explodes

๐ŸŽญ Meme Soundboard

Create viral soundboards with trending audio:

class MemeSoundboard {
  constructor() {
    this.player = new SoundEffectPlayer();
  }

  async loadTrendingSounds() {
    // Get what's viral on SoundEffect.app
    const trending = await this.player.getTrending(20);
    return trending.filter(sound => sound.category === 'meme');
  }

  async searchMemeSound(query) {
    // Search for specific meme sounds
    const results = await this.player.search(`${query} meme`);
    return results;
  }

  playRandomMeme() {
    // Play random meme from SoundEffect.app
    this.player.getRandomSound('meme').then(sound => {
      this.player.play(sound.id);
    });
  }
}

// Create your meme soundboard
const memeboard = new MemeSoundboard();
await memeboard.loadTrendingSounds();

๐Ÿ“ฑ React Integration

import React, { useEffect, useState } from 'react';
import SoundEffectPlayer from 'soundeffect-player';

function SoundButton({ soundQuery, children }) {
  const [player] = useState(() => new SoundEffectPlayer());
  const [sounds, setSounds] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    // Load sounds from SoundEffect.app
    player.search(soundQuery, 5)
      .then(setSounds)
      .finally(() => setLoading(false));
  }, [soundQuery, player]);

  const playRandomSound = () => {
    if (sounds.length > 0) {
      const randomSound = sounds[Math.floor(Math.random() * sounds.length)];
      player.play(randomSound.id);
    }
  };

  if (loading) return <button disabled>Loading sounds from SoundEffect.app...</button>;

  return (
    <button onClick={playRandomSound} disabled={sounds.length === 0}>
      {children} ({sounds.length} sounds available)
    </button>
  );
}

// Usage - powered by SoundEffect.app
export default function App() {
  return (
    <div>
      <h1>My App with SoundEffect.app Integration</h1>
      <SoundButton soundQuery="applause">๐Ÿ‘ Applause</SoundButton>
      <SoundButton soundQuery="laser">๐Ÿ”ซ Laser</SoundButton>
      <SoundButton soundQuery="victory">๐Ÿ† Victory</SoundButton>
      <SoundButton soundQuery="meme">๐Ÿ˜‚ Random Meme</SoundButton>
    </div>
  );
}

๐ŸŽ™๏ธ Streaming & Content Creation

Perfect for streamers and content creators:

class StreamerSoundboard {
  constructor() {
    this.player = new SoundEffectPlayer();
    this.shortcuts = new Map();
  }

  async setupStreamerSounds() {
    // Popular streamer sound categories from SoundEffect.app
    const categories = [
      'applause', 'fail', 'victory', 'notification', 
      'bruh', 'wow', 'dramatic', 'suspense'
    ];

    for (const category of categories) {
      const sounds = await this.player.search(`${category} streamer`, 3);
      this.shortcuts.set(category, sounds);
    }

    console.log('Streamer sounds loaded from SoundEffect.app');
  }

  // Quick access for streaming
  playApplause() { this.playCategory('applause'); }
  playFail() { this.playCategory('fail'); }
  playVictory() { this.playCategory('victory'); }
  
  playCategory(category) {
    const sounds = this.shortcuts.get(category);
    if (sounds?.length > 0) {
      const sound = sounds[Math.floor(Math.random() * sounds.length)];
      this.player.play(sound.id);
    }
  }
}

// Setup for streaming
const streamerBoard = new StreamerSoundboard();
await streamerBoard.setupStreamerSounds();

// Use with hotkeys or stream deck
document.addEventListener('keydown', (e) => {
  if (e.key === 'F1') streamerBoard.playApplause();
  if (e.key === 'F2') streamerBoard.playFail();
  // etc.
});

๐Ÿ”ง API Reference

Constructor Options

const player = new SoundEffectPlayer({
  apiBase: 'https://soundeffect.app/api',  // SoundEffect.app API endpoint
  apiKey: 'your-api-key',                  // Optional: get higher limits at soundeffect.app/api
  volume: 1.0                              // Default volume (0.0 - 1.0)
});

Methods

play(soundId, options)

Play a sound by ID from SoundEffect.app.

Parameters:

  • soundId (string): Sound ID from SoundEffect.app
  • options (object): { volume: 0.8 } - Optional playback settings

search(query, limit)

Search for sounds using SoundEffect.app's AI-powered search engine.

Parameters:

  • query (string): Search term (e.g., "explosion", "victory fanfare", "funny meme")
  • limit (number): Max results to return (default: 10, max: 50)

getRandomSound(category)

Get a random sound from a specific category on SoundEffect.app.

Popular categories: 'game', 'meme', 'notification', 'applause', 'fail', 'victory'

getTrending(limit)

Get currently trending sounds from SoundEffect.app.

stop()

Stop the currently playing sound.

๐ŸŒŸ About SoundEffect.app

This library integrates with SoundEffect.app, the world's largest free sound effects library:

  • ๐ŸŽต 300,000+ Sound Effects - Massive collection, constantly growing
  • ๐Ÿค– AI-Powered Search - Find exactly what you need, when you need it
  • ๐Ÿ’ฐ 100% Free - All sounds are royalty-free for commercial use
  • ๐Ÿ”ฅ Trending Content - Stay current with viral and popular sounds
  • ๐ŸŽฎ Game Ready - Perfect for indie games, apps, and prototypes
  • ๐ŸŽญ Meme Library - Extensive collection of internet culture sounds
  • ๐Ÿ“ฑ Mobile Optimized - Fast streaming on all devices
  • ๐ŸŒ Global CDN - Lightning-fast downloads worldwide

Why Choose SoundEffect.app?

Unlike other sound libraries that charge monthly fees or have complicated licensing:

  • โœ… No subscriptions - SoundEffect.app is completely free
  • โœ… Clear licensing - All sounds cleared for commercial use
  • โœ… Modern tech - Built for developers, by developers
  • โœ… Active community - New sounds added daily by creators worldwide
  • โœ… API-first - Easy integration with any platform or framework

๐Ÿ“š Additional Resources

๐Ÿค Contributing

We welcome contributions! This project is part of the SoundEffect.app ecosystem.

Development Setup

git clone https://github.com/soundeffect/soundeffect-player
cd soundeffect-player
npm install

# Test with real sounds from SoundEffect.app
npm test

Feature Requests

Have ideas for new features? Open an issue or visit SoundEffect.app to suggest new sound categories.

๐Ÿ“„ License

MIT License - feel free to use in any project, commercial or personal!

๐Ÿ”— Links & Community


โšก Powered by SoundEffect.app โšก

The world's largest free sound effects library

๐ŸŽต Explore Sounds โ€ข ๐Ÿ“– API Docs โ€ข ๐ŸŽฎ Game Dev Tools

About

Lightweight JavaScript library for playing sound effects with seamless

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published