Permalink
Browse files

minor touches

  • Loading branch information...
xk committed Feb 23, 2012
1 parent 7540fd3 commit 89f18247df39f76cf3f5e88556bb6ad1b9b21104
Showing with 12 additions and 8 deletions.
  1. +6 −3 sound.cc
  2. +3 −2 test06.js
  3. +1 −1 test07.js
  4. +1 −1 test08.js
  5. +1 −1 test09.js
View
@@ -15,14 +15,14 @@
- bufferify(path, cb) renders it in a background thread and calls cb(err, buffer) when done.
*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <v8.h>
#include <node.h>
#include <node_buffer.h>
#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
#include <pthread.h>
-#include <stdlib.h>
#if defined (__APPLE__)
#include <AudioToolbox/AudioToolbox.h>
@@ -973,6 +973,9 @@ v8::Handle<Value> BufferifySync (const Arguments &args) {
str= args[0]->ToString();
job.str= *String::Utf8Value(str);
job.strLen= str->Utf8Length();
+ if (!job.strLen) {
+ return Undefined();
+ }
job.bytesRead= 0;
job.qHead= NULL;
View
@@ -14,7 +14,8 @@ while (len--) {
}
-require('./build/default/sound').create(buffer).loop(1e6).volume(1).play(); // loop
+var S= require('sound');
+S.create(buffer).loop(1e6).volume(1).play(); // loop
-setTimeout(Date.now, 1e9); // forever
+setTimeout(Date, 1e9); // forever
View
@@ -5,7 +5,7 @@ var len= buffer.length;
while (len--) buffer[len]= len%256; // saw;
-require('./build/default/sound').create(buffer).loop(1e6).volume(1).play(); // loop
+require('sound').create(buffer).loop(1e6).volume(1).play(); // loop
setTimeout(Date.now, 1e9); // forever
View
@@ -28,6 +28,6 @@ while (len--) {
}
-require('./build/default/sound').create(buffer).loop(1e6).volume(1).play(); // loop
+require('sound').create(buffer).loop(1e6).volume(1).play(); // loop
setTimeout(Date.now, 1e9); // forever
View
@@ -28,7 +28,7 @@ do {
} while (len);
-require('./build/default/sound').create(buffer).loop(1e6).volume(1).play(); // loop
+require('sound').create(buffer).loop(1e6).volume(1).play(); // loop
setTimeout(Date.now, 1e9); // forever

0 comments on commit 89f1824

Please sign in to comment.