Giter Site home page Giter Site logo

blip's Introduction

Blip

Blip is a library to procedurally generate and play sound effects for games. The library is based on the Sfxr project by Dr.Petter.

Installation

You can use Blip in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

https://github.com/britzl/blip/archive/master.zip

Or point to the ZIP file of a specific release.

Usage

You generate a sound by calling one of the predefined sound effect groups:

local seed = 1234
local wav = blip.explosion(seed)

This will generate a sound effect as a WAV sample using the specified seed. The seed is a number that is used to generate a specific version of the sound effect. Passing in a certain seed will always result in the same sound. Use the example app to find seeds that you like and use them in your own project.

Once you have a sound effect that you like you set it on an existing sound component and play the sound:

-- set the sound data on the sound component #sound
local resource_path = go.get("#sound", "sound")
resource.set_sound(resource_path, wav)

-- play the sound
sound.play("#sound")

Try it!

Try the HTML5 version of the example app.

blip's People

Contributors

britzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

aurodev

blip's Issues

No sound on Mac

Demo on web doesn't play sound.

Added it as library to my own project, executed code. Originally errors - those are gone with the recent update. Still no actual sound. Rebooted to ensure no local issue...

Having a sound component and using blip crashes the game

First, thank you for create a great asset :)

I'm having a problem where I'm using a sound component to play bg-music.
As soon as I call blip from a script e.g. local hurt_sound = blip.hurt(3185);, my game crashes.
If I remove either blip or the sound component, the games runs just file.

INFO:ENGINE: Defold Engine 1.2.164 (2be2687)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'

Registered lua_script_instance Extension
INFO:DLIB: SSDP: Started on address 192.168.178.16
INFO:BLIP: newSource alGenSources
ERROR:SOUND: Invalid Name
Assertion failed: (Capacity() - Size() > 0), function Push, file /Users/builder/ci/builds/engine-darwin-64-master/build/tmp/dynamo_home/sdk/include/dmsdk/dlib/array.h, line 471.
INFO:CRASH: Successfully wrote Crashdump to file: /Users/wilcoverhoeven/Library/Application Support/Defold/_crash
ERROR:CRASH: CALL STACK:

# 0 pc   0x17f1fb3d DSExternalDisplay _sigtramp+29

Most of the seeds cause error on Windows 10

I cloned this project to try to find a seed for my project that uses blip, but on Windows, practically every seed causes the error both in my project and example project from this repo:

bad argument #1 to 'play' (userdata expected, got nil)

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.