[sound] fix sound() macro under OSX 56/20756/3
St├ęphane Mottelet [Tue, 29 Jan 2019 10:30:05 +0000 (11:30 +0100)]
test_run sound bug_1609 was failing because of missing OS switch

Change-Id: I1d0391b61fee8dfa50d5e318dafca1e04d9fecc2

scilab/modules/sound/macros/sound.sci

index e49eed5..0a6cf62 100644 (file)
@@ -35,7 +35,13 @@ function []=sound(y,fs,bits,aplay)
     if nargin<3 then
         bits = 16;
     end
-    if nargin < 4 aplay="aplay"; end
+    if nargin < 4 then
+        if getos() == "Darwin" then
+            aplay = "afplay"
+        else
+            aplay = "aplay";
+        end
+    end
     // Make sure y is in the range +/- 1
     y = max(-1,min(y,1));
     // Make sure that there's one column