Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ya va con cualquier versión desde 0.3.6 hasta 0.6.6

  • Loading branch information...
commit d57712a7add469eff1194beab02efcb5e79bb6a8 1 parent 89e63c6
@xk authored
View
6 .lock-wscript
@@ -1,8 +1,8 @@
-argv = ['/Users/jorge/JAVASCRIPT/bin/node-waf', 'configure', 'clean', 'install']
+argv = ['/Users/jorge/JAVASCRIPT/binarios/bin/node-waf', 'configure', 'uninstall', 'distclean', 'configure', 'build', 'install']
blddir = '/Users/jorge/JAVASCRIPT/node-sound/build'
-commands = {'dist': 0, 'configure': True, 'distcheck': 0, 'install': True, 'build': 0, 'clean': True, 'distclean': 0, 'check': 0, 'uninstall': 0}
+commands = {'dist': 0, 'configure': True, 'distcheck': 0, 'install': False, 'build': True, 'clean': 0, 'distclean': True, 'check': 0, 'uninstall': True}
cwd = '/Users/jorge/JAVASCRIPT/node-sound'
-environ = {'SSH_AUTH_SOCK': '/tmp/launch-3NWBPc/Listeners', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '273.1', 'SHELL': '/bin/bash', 'LOGNAME': 'jorge', 'USER': 'jorge', 'HOME': '/Users/jorge', 'PATH': '/Users/jorge/JAVASCRIPT/bin/:/usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/opt/local/bin', 'DISPLAY': '/tmp/launch-brTI6E/org.x:0', 'TMPDIR': '/var/folders/+A/+Atg2INUGw4BX1NCXMla8U+++TY/-Tmp-/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'es_ES.UTF-8', 'TERM': 'xterm-color', 'Apple_PubSub_Socket_Render': '/tmp/launch-BVwyUI/Render', 'VERSIONER_PYTHON_VERSION': '2.6', 'SHLVL': '1', 'OLDPWD': '/Users/jorge/JAVASCRIPT', '__CF_USER_TEXT_ENCODING': '0x1F9:0:0', 'PWD': '/Users/jorge/JAVASCRIPT/node-sound', '_': '/Users/jorge/JAVASCRIPT/bin/node-waf', 'COMMAND_MODE': 'unix2003'}
+environ = {'SSH_AUTH_SOCK': '/tmp/launch-Gwen8Q/Listeners', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'TERM_PROGRAM_VERSION': '273.1', 'SHELL': '/bin/bash', 'LOGNAME': 'jorge', 'USER': 'jorge', 'HOME': '/Users/jorge', 'PATH': '/Users/jorge/JAVASCRIPT/binarios/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/opt/local/bin', 'DISPLAY': '/tmp/launch-zA26sf/org.x:0', 'TMPDIR': '/var/folders/+A/+Atg2INUGw4BX1NCXMla8U+++TY/-Tmp-/', 'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'es_ES.UTF-8', 'TERM': 'xterm-color', 'Apple_PubSub_Socket_Render': '/tmp/launch-fkoadp/Render', 'VERSIONER_PYTHON_VERSION': '2.6', 'SHLVL': '1', 'OLDPWD': '/Users/jorge/JAVASCRIPT/threads_a_gogo', 'MACOSX_DEPLOYMENT_TARGET': '10.6', '__CF_USER_TEXT_ENCODING': '0x1F9:0:0', 'PWD': '/Users/jorge/JAVASCRIPT/node-sound', '_': '/Users/jorge/JAVASCRIPT/binarios/bin/node-waf', 'COMMAND_MODE': 'unix2003'}
files = []
hash = 0
options = {'compile_targets': None, 'force': False, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'destdir': '', 'keep': False, 'zones': '', 'blddir': '', 'prefix': '/usr/local/', 'jobs': 2, 'srcdir': '', 'check_cxx_compiler': 'g++'}
View
3  Changelog
@@ -10,3 +10,6 @@ Ver test12.js DEMO DE BUFFERIFY
test-sinewave.js
test-sinewaves.js
+2011-12-20
+
+Ahora funciona con cualquier node >= 0.3.6 (comprobado desde 0.3.6 hasta 0.6.6)
View
24 README.md
@@ -1,14 +1,18 @@
#node-sound The best sound library for node.js
+Node-sound es un módulo nativo para node.js que sirve para crear/sintetizar y reproducir sonidos en tu Mac, en JavaScript, a partir de un buffer, usando las librerías de sonido incorporadas en el Mac OSX.
+
##Instalar
-**NOTA: Sólo funciona con node >= v0.3 y <= v0.5.0**
+**NOTA: Sólo funciona con node >= v0.3.6**
+**NOTA: Sólo funciona con Mac OSX**
-**You need node >= v0.3 and <= v0.5.0 to run this program**
+**You need node >= v0.3.6 to run this program**
+**Only for Mac OSX**
-**2011-29-10 -> It does NOT work with node 0.5.11**
+(Puedes encontrar cualquier versión de node, desde la primera hasta la última, en: http://nodejs.org/dist/ )
-Node-sound es un módulo nativo para node.js. Nativo significa fundamentalmente dos cosas: que está escrito en C y que para poder usarlo hay que compilarlo primero.
+Que un módulo sea nativo significa fundamentalmente dos cosas: que está escrito en C y que para poder usarlo hay que compilarlo primero.
Es muy fácil de hacer, suponiendo que ya tengas node.js instalado (y compilado y funcionando).
@@ -21,13 +25,15 @@ Después descomprimes ese fichero y creará una carpeta *xk-node-sound-xxxx*. Pu
Por último, para compilar el módulo teclea:
cd xk-node-sound
- node-waf configure clean build
+ node-waf configure uninstall distclean configure build install
En mi Mac eso produce algo así, donde lo más importante es la última línea: *'build' finished successfully*:
<img src= "https://github.com/xk/node-sound/raw/master/imgs/node-waf-output.png" border= "0">
-Si todo ha ido bien, el módulo compilado se encontrará en *xk-node-sound/build/default/sound.node*
+Si todo ha ido bien, el módulo compilado se encontrará, dependiendo de la versión de node que tengas instalada, en *xk-node-sound/build/default/sound.node* (versiones más antiguas de node), o en *xk-node-sound/build/release/sound.node* (versiones más modernas de node)
+
+Si algo no va bien, puedes abrir un ticket haciendo click en "issues" arriba, en esta misma página. Describe el problema lo mejor posible y yo recibiré un email automáticamente, y trataré de resolverlo lo antes posible.
<p>&nbsp;</p>
##Manual de instrucciones:
@@ -40,9 +46,13 @@ Lo primero es cargar el módulo y asignarle un nombre (por ejemplo *Sound*) en l
Si node no es capaz de encontralo, tienes dos opciones.
-La mejor opción: translada el fichero *sound.node* a la carpeta *node_modules*, o bien, especifica el path completo hasta la carpeta en la que se encuentra *sound.node* :
+La mejor opción: translada el fichero *sound.node* a la carpeta *node_modules* (si no existe, simplemente créala), o bien, especifica el path completo hasta la carpeta en la que se encuentra *sound.node* :
require('/absolute/path/to/sound.node's/folder/sound'); // ugh !
+
+Por ejemplo, los tests usan:
+
+ require('./build/default/sound');
El módulo (que una vez `require()`d se llama *Sound*) tiene 4 métodos:
View
9 err_01.js
@@ -1,6 +1,13 @@
// exercise callbacks;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var quit= setTimeout(Date.now, 1e9); // don't quit
View
1  sound.cc
@@ -18,7 +18,6 @@
#include <v8.h>
#include <node.h>
#include <node_buffer.h>
-#include <ev.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
View
9 test-multiwaves-stereo-polyphonic.js
@@ -82,7 +82,14 @@ var createWave= (function () {
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 200;
View
9 test-multiwaves-stereo.js
@@ -82,7 +82,14 @@ var createWave= (function () {
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 50;
View
9 test-noise-stereo-polyphonic.js
@@ -82,7 +82,14 @@ var createWave= (function () {
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 200;
View
9 test-noise-stereo.js
@@ -82,7 +82,14 @@ var createWave= (function () {
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 200;
View
9 test-sawtoothwave.js
@@ -43,7 +43,14 @@ function createSquareWave (f /*frequency in Hz*/, seconds /*duration in seconds*
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var buffer= createSquareWave(1e3/*f in Hz*/, 1/*duration in seconds*/);
var sound= Sound.create(buffer);
sound.loop(3).play(cb);
View
9 test-sawtoothwaves.js
@@ -43,7 +43,14 @@ function createSawtoothWave (f /*frequency in Hz*/, seconds /*duration in second
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 20;
View
9 test-sinewave.js
@@ -43,7 +43,14 @@ function createSineWave (f /*frequency in Hz*/, seconds /*duration in seconds*/)
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var buffer= createSineWave(1e3/*f in Hz*/, 1/*duration in seconds*/);
var sound= Sound.create(buffer);
sound.loop(3).play(cb);
View
9 test-sinewaves.js
@@ -43,7 +43,14 @@ function createSineWave (f /*frequency in Hz*/, seconds /*duration in seconds*/)
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 20;
View
9 test-squarewave.js
@@ -43,7 +43,14 @@ function createSquareWave (f /*frequency in Hz*/, seconds /*duration in seconds*
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var buffer= createSquareWave(1e3/*f in Hz*/, 1/*duration in seconds*/);
var sound= Sound.create(buffer);
sound.loop(3).play(cb);
View
9 test-squarewaves.js
@@ -43,7 +43,14 @@ function createSquareWave (f /*frequency in Hz*/, seconds /*duration in seconds*
var DONE= 0;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var musiquilla= [];
var i= 20;
View
9 test00.js
@@ -1,7 +1,14 @@
// latency tests. not too good, it's about 30 ms.
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var tinyBuffer= new Buffer(1024); // 532/(44100*4) -> 0,003015873016 s -> ~3 ms
var len= tinyBuffer.length;
View
9 test01.js
@@ -1,6 +1,13 @@
// tests proper destruction/absence of leaks when there's unreferenced sound (and buffer) objects that are still play()ing.
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
(function loop () {
process.nextTick(loop);
View
9 test02.js
@@ -18,7 +18,14 @@ while (i--) {
}
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
(function loop () {
View
9 test03.js
@@ -5,7 +5,14 @@
// ===================================================================
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var snds= [];
var bufs= [];
View
9 test04.js
@@ -1,6 +1,13 @@
// test .play() and .pause();
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var buf= new Buffer(256*256);
var i= buf.length;
View
9 test05.js
@@ -5,7 +5,14 @@ var len= buffer.length;
//while (len--) buffer[len]= Math.floor(Math.random()*256); // noise
while (len--) buffer[len]= len%256; // saw
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var sound= Sound.create(buffer).volume(0).loop(1e9).play();
View
9 test10.js
@@ -1,6 +1,13 @@
// exercise callbacks;
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
setTimeout(function nop(){}, 1e9); // don't quit
View
9 test11.js
@@ -1,6 +1,13 @@
// exercise recursive .play() from the callback; It's a bad idea, looping via the cb() produces glitches, should really use .loop() instead !
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var quit= setTimeout(function nop(){}, 1e9); // don't quit
View
9 test12.js
@@ -1,6 +1,13 @@
// Test bufferifySync()
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var sounds= ['sound.wav', 'sound.m4a', 'sound.aif', 'sound.mp3', 'sound.au', 'Sous La Pluie.mp3'];
var i= sounds.length;
View
9 test13.js
@@ -1,6 +1,13 @@
// bufferifies in a loop to detect leaks.
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var sounds= ['sound.wav',
'Sous La Pluie.mp3',
'sound.m4a',
View
9 test14.js
@@ -1,6 +1,13 @@
// test for async bufferify()s IN SERIES in a loop to detect leaks and other problems.
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var sounds= ['sound.wav', 'sound.aif', 'sound.au', 'sound.mp3', 'sound.m4a'];
View
9 test15.js
@@ -1,6 +1,13 @@
// test for multiple async bufferify()s IN PARALLEL in a loop to detect leaks and other problems.
-var Sound= require('./build/default/sound');
+var Sound;
+var paths= ['./build/default/sound', './build/release/sound', 'sound'];
+while (paths.length) {
+ var p= paths.pop();
+ try { Sound= require(p) } catch (e) { continue }
+ console.log("Módulo de sonido encontrado en: '"+ p+ "'");
+ break;
+}
var sounds= ['sound.wav', 'sound.aif', 'sound.au', 'sound.m4a', 'sound.mp3'];
var ctr= 0;
Please sign in to comment.
Something went wrong with that request. Please try again.