[Scilab-users] Outputting a "continuous" sound with Scilab

Samuel Gougeon sgougeon at free.fr
Wed Apr 29 22:19:35 CEST 2015


Hello Antoine,

Le 24/04/2015 16:31, Antoine Monmayrant a écrit :
> Hi everyone,
>
> I'm trying to use Scilab to generate a soundwave with a given 
> frequency and output it continuously.
> Basically, I'd like to get a simple "software-based" function 
> generator: a slider to set the frequency and the sound being played 
> continuously in the background.
> Is this possible in Scilab?
> I'm fine with the gui & callback part, but for sound output 'playsnd' 
> and 'sound' do not seem to be able to loop over a given sample without 
> any gap.
>
> Any suggestion or alternative software I could use?
If you are successful in installing Python 2.7 and NumPy, you may try 
using the PIMS module and execute the following code with pyEvalStr(..):

import  audiere
d  =  audiere.open_device()
t  =  d.create_tone(17000)  #  17  KHz
t.play()  #  non-blocking  call
import  time
time.sleep(5)
t.stop()

This Python's code is taken from
http://stackoverflow.com/questions/974071/python-library-for-playing-fixed-frequency-sound#answers-header 


May i guess (i do not know Python's language) that the time.sleep(..) 
instruction may be dropped in order to get a continuous sound, lasting 
as long as t.stop() is not called. It can be called only after other 
Scilab instructions and callbacks and so on.
For my part, i did not succeed in installing NumPy on my win7_x64 (The 
well installed Python 2.7 is not detected by NumPy installer). PIMS is 
well loaded, but then i get an error when executing the pyEvalStr() 
example.

Have nice trials
Regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150429/f8630241/attachment.htm>


More information about the users mailing list