Giter Site home page Giter Site logo

node-sdlmixer's People

Contributors

crishoj avatar japj avatar tmpvar avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

node-sdlmixer's Issues

more info in playingDone callback

The playingDone callback should have more information (i.e. fileName, channel). This could be usefull in order to move all the printf statements from the C++ code to the javascript side.

Trying to build on debian for node 0.10.7

NPM install did not work so re-built it.
Seemed to build OK
when trying to run simple.js (and having checked require path)
I get "Cannot find module './build/default/node-sdlmixer'"

Segfault on node 10.25 OSX and Linux (Fedora 64bit)

I'm not sure if this project is in active maintenance, but you accepted my pull req for node-gyp changes so I'll file this issue. SDL is such a cool way to do sound in node.

If I play several sounds the process eventually segfaults. Sometimes this happens after the first sound and sometimes it takes a few to trigger it. It always seems to happen after about 10 calls to play().

I built my node-sdlmixer binary with debug symbols against libSDL2 although I get the same crash with SDL1. I tried this on OSX and Fedora.

test.js

var sdlmixer = require("../sdlmixer");

console.log("Opened audio at " + sdlmixer.audioRate + " Hz " + sdlmixer.audioFormat + " bit " +
        sdlmixer.audioChannels + " and " + sdlmixer.numberOfAudioChannels + " channels.")

setInterval(function() {
  sdlmixer.play(__dirname + '/../wavs/drums/tick.wav', function(fileName, channel) {
    console.log(channel +": "+fileName + " done")
  });
}, 1000);
retnex:test dan$ node test.js
Opened audio at 22050 Hz 16 bit stereo and 32 channels.
0: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
1: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
2: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
3: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
4: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
5: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done
Segmentation fault: 11

GDB crash

$ gdb --args node test.js
Opened audio at 22050 Hz 16 bit stereo and 32 channels.
0: /Users/dan/sandbox/thirdparty/node-sdlmixer/test/../wavs/drums/tick.wav done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000007600610087
0x0000000100124d8e in uv__async_event ()
(gdb)

GDB backtrace

(gdb) bt
#0  0x0000000100124d8e in uv__async_event ()
#1  0x0000000100124f16 in uv__async_io ()
#2  0x0000000100131b90 in uv__io_poll ()
#3  0x0000000100125343 in uv_run ()
#4  0x000000010000a5ed in node::Start ()
#5  0x00000001000017f4 in start ()

compiler info:

$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.45.3) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

Occasionally I'll get a "Bus error 10" and a few times I have crashed in Node::StreamWrap. I can't reproduce these situations reliably though. I'll try to update this ticket if I can repro them.

new api to load sounds before play

currently the play api actually will load (+"parse" the sound) from disk and then start playing.

if you want to play the same sound often, it makes more sense to actually load it first and have it 'parsed' only once.

use EventEmitter for global events

use the EventEmitter mechanism to provide global events like:

start/stop playing on a channel (instead of 'play' with a start callback)

Path based dependencies.

It looks like your home directory is stashed somewhere in your files. And, those files got pushed to npm. If I do spend more time on it I'll send a pull request. Otherwise, here's your ticket. :)

sudo npm install node-sdlmixer
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info preinstall [email protected]
Nothing to clean (project not configured)
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for program sdl-config : /usr/bin/sdl-config
'configure' finished successfully (0.037s)
Waf: Entering directory /home/japj/github/node-sdlmixer/build' Waf: Leaving directory/home/japj/github/node-sdlmixer/build'
Traceback (most recent call last):
File "/usr/local/bin/node-waf", line 16, in
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/home/japj/github/node-sdlmixer/build'
npm info [email protected] Failed to exec preinstall script
npm ERR! install failed Error: [email protected] preinstall: node-waf clean || true; node-waf configure build
npm ERR! install failed sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR! install failed at ChildProcess. (/usr/local/lib/node/.npm/npm/0.3.18/package/lib/utils/exec.js:49:20)
npm ERR! install failed at ChildProcess.emit (events.js:67:17)
npm ERR! install failed at ChildProcess.onexit (child_process.js:192:12)
npm info install failed rollback
npm info uninstall [ '[email protected]' ]
npm info preuninstall [email protected]
npm info uninstall [email protected]
npm info auto-deactive not symlink
npm info postuninstall [email protected]
npm info uninstall [email protected] complete
npm info install failed rolled back
npm ERR! Error: [email protected] preinstall: node-waf clean || true; node-waf configure build
npm ERR! sh "-c" "node-waf clean || true; node-waf configure build" failed with 1
npm ERR! at ChildProcess. (/usr/local/lib/node/.npm/npm/0.3.18/package/lib/utils/exec.js:49:20)
npm ERR! at ChildProcess.emit (events.js:67:17)
npm ERR! at ChildProcess.onexit (child_process.js:192:12)
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the node-sdlmixer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf clean || true; node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sdlmixer
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.38-8-generic
npm ERR! argv { remain: [ 'node-sdlmixer' ],
npm ERR! argv cooked: [ 'install', 'node-sdlmixer' ],
npm ERR! argv original: [ 'install', 'node-sdlmixer' ] }
npm not ok

Possibility for one line installer?

Do you think it's possible to bundle together the sdl dependencies so the package could be installed via one line instead of requiring additional installation steps using brew or apt-get ?

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.