Search code examples
audiopharo

How to use computers mic as Sound Input in Pharo


It is possible to use a file as InputSound (for example if you want to play a music).

But, I do not find a way to use the mic of my computer as an input stream sound in Pharo.

Any ideas?


Solution

  • The Sound package (originally from Squeak) contains a morph called SpectrumAnalyzerMorph which can read from the microphone (among other things). You can load it by doing this in a playground;

    SpectrumAnalyzerMorph new openInWindow 
    

    You can load the Sound packe from Squeak into Pharo, and it is available both on Smalltalkhub (http://smalltalkhub.com/#!/~PharoExtras/Sound) and here is also a fork I've made which implement playing sounds directly from an object (instead of a file);

    https://github.com/psvensson/PharoSound/edit/master/README.md

    Metacello new baseline: 'PharoSound'; 
      repository: 'github://psvensson/PharoSound:master'; 
      load.