Question: Play Audio file from Maple

I performed the following procedure to simulate the function of Matlab soundsc(Scale data and play as sound).

N := 16000;
 t := Vector(N, i-> evalf(2*i/(N-1)) end proc);

sound1 := sin~((2*evalf(Pi)*440)*t);

aud := Create(sound1, duration = 10.0);

PlayWave := proc (data, SampleFreq)
local SoundFile;
setattribute(data, SampleFreq, 16, 1);
SoundFile := "Bflat3.wav";
Write(SoundFile, data);
process[launch](cat("sndrec32.exe ", SoundFile))
end proc;

PlayWave(aud, 8000)
But I get the following error when executing it

Error, (in process:-launch) could not execute command, sndrec32.exe Bflat3.wav; The system can not find the file specified.

How I can do, maple play an audio file?


Please Wait...