This repository has been archived by the owner on Jun 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use ev_async for play notification instead of eio_custom, this also f…
…rees up usage of the node thread pool and now we can play audio on all the channels at exactly the same time because we don't starve the actual thread pool with synchronous wait for audio played behaviour
- Loading branch information
Showing
4 changed files
with
107 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
var sdlmixer = require("../sdlmixer"), | |||
sys = require("sys"), | |||
puts = sys.puts; | |||
|
|||
puts("Opened audio at " + sdlmixer.audioRate + " Hz " + sdlmixer.audioFormat + " bit " + | |||
sdlmixer.audioChannels + " and " + sdlmixer.numberOfAudioChannels + " channels.") | |||
|
|||
// play with a callback | |||
|
|||
sdlmixer.play(__dirname + "/../wavs/sfx/alarm.wav", function () { | |||
puts("done") | |||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters