Code Monkey home page Code Monkey logo

sound's Introduction

PixiJS Sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.

Node.js CI npm version

Features

  • Pausing and resuming
  • Independent volume control
  • Support blocking or layered sounds (multiple instances)
  • Support for PIXI.Loader system
  • Dynamic filters:
    • ReverbFilter
    • DistortionFilter
    • EqualizerFilter
    • StereoFilter
    • TelephoneFilter

Known Compatibility

  • Chrome 58+
  • Firefox 49+
  • Safari 10+
  • iOS 9+
  • IE 9+

Usage

Installation is available by NPM:

npm i @pixi/sound --save

To import into your project, for instance, when using Webpack, Parcel, Rollup, or another bundler:

import { sound } from '@pixi/sound';

sound.add('my-sound', 'path/to/file.mp3');
sound.play('my-sound');

Browser Usage

If you're using a <script> element to import @pixi/sound into your project, then the SoundLibrary object is PIXI.sound global.

<!-- PixiJS must be imported before @pixi/sound -->
<script src="https://unpkg.com/pixi.js/dist/browser/pixi.min.js"></script>

<!-- found here, if not using CDN "./node_modules/@pixi/sound/dist/pixi-sound.js" -->
<script src="https://unpkg.com/@pixi/sound/dist/pixi-sound.js"></script>

<script>
    PIXI.sound.add('my-sound', 'path/to/file.mp3');
    PIXI.sound.play('my-sound');
</script>

Resources

License

MIT License.

sound's People

Contributors

bigtimebuddy avatar yueyuzhao avatar dependabot[bot] avatar qtiki avatar andrewstart avatar ericente avatar korilakkuma avatar cursedcoder avatar patrick-hammond avatar hendrysadrak avatar gorisanson avatar yuzeyang avatar connorjclark avatar telime avatar windyrain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.