Coder Social home page Coder Social logo

agk-soundsource's Introduction

AGK-SoundSource

Quick way to create 3D sound Sources using AGK-SoundObject

If you want to play 3D sounds in your game this is the quickest method to do this.

Installation

Using NPM: npm install agk-soundsource

Usage

NOTE:

There is currently a bug in Howler that prevents 3D from working properly. To fix this until howler is updated, you must manually edit node_modules/howler/dist/howler.js. Find the line where exports.howler and exports.howl are defined. Cut them and paste them at the bottom of the file. They will work then. See https://github.com/goldfire/howler.js/issues/916 issue.

Code

import SoundSource from "agk-soundsource";

// Look at agk-soundobject to see how the base directory and extension can be changed. For now, it assumes the sounds are in ./sounds/ and the extension is .webm. // Load meow.webm from the ./sounds/ folder at coordinates 5, 5, 5 and loop it.

const source = new SoundSource("meow", 5, 5, 5, true); // play the source source.play(); // Update the position to 10, 10, 10 source.pos(10, 10, 10); // to update listener position, use agk-soundobject

Contributing

This thing doesn't do much yet. It will eventually get more functionality. If you have ideas, feel free to add them and PR.

License

This code is MIT licensed.

agk-soundsource's People

Stargazers

 avatar

Watchers

Talon avatar  avatar

Forkers

yncat tsatria03

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.