# Re: \[psychtoolbox\] OSX: snd on mac os x

**URL:** <https://psychtoolbox.discourse.group/t/re-psychtoolbox-osx-snd-on-mac-os-x/980>\
**Category:** Uncategorized\
**Created:** [March 10, 2005, 4:57pm UTC](https://psychtoolbox.discourse.group/t/re-psychtoolbox-osx-snd-on-mac-os-x/980 "2005-03-10T16:57:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamassian](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mamassian](https://psychtoolbox.discourse.group/u/mamassian)\
**Post date:** [March 10, 2005, 4:57pm UTC](https://psychtoolbox.discourse.group/t/re-psychtoolbox-osx-snd-on-mac-os-x/980/1 "2005-03-10T16:57:12Z")

</div>

Hi Josh,  
  
Regarding your request about playing sounds  
aynchronously, I've been using 'audioplayer' (see some  
bits of code below). I'd be interested if you or  
somebody else have a better solution.  
  
Best,  
Pascal Mamassian  
  
\*\*\*\*\*  
  
sampFreq = 44100; % sample frequency (Hz)  
beepFreq = 440; % signal frequency (Hz)  
beepDura = 1.0; % duration (sec)  
nn = sampFreq \* beepDura; % number of samples  
tt = linspace(0, beepDura, nn); % time samples  
myBeep = sin(2\*pi\*beepFreq\*tt);  
playTest = audioplayer(myBeep, sampFreq);  
play(playTest);  
  
\*\*\*\*\*  
  
  
--- joshigold \<[joshigold@...](mailto:joshigold@...)\> wrote:  
---------------------------------  
  
  
Does anybody have any tools for playing a sound  
asynchronously  
from Matlab in mac os x? It looks like the  
psychtoolbox "snd"  
command for os x (even in the most up-to-date version,  
1.0.42)  
just calls matlab's "sound" command, which blocks  
until the sound  
is playing.  
  
I've even tried making a little command-line tool for  
playing .aiff  
files that I can call from within Matlab & run in the  
background ..  
this works but there's a slight delay (~200 ms) in  
opening the   
file that I'd like to avoid...  
  
Thanks in advance for any help you can offer.  
  
Josh  
  
------  
Joshua Gold  
University of Pennsylvania  
Department of Neuroscience  
116 Johnson Pavilion  
3610 Hamilton Walk  
Philadelphia, PA 19104-6074  
  
office phone: 215-746-0028  
lab phone: 215-746-0168  
e-mail: [jigold@...](mailto:jigold@...)  
  
  
  
  
  
  
  
  
Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
Please indicate OS9, OSX, or WIN version, and include  
your full name.  
Denis Pelli, David Brainard, and Allen Ingling.  
[http://psychtoolbox.org](http://psychtoolbox.org)  
  
  
  
Yahoo! Groups Sponsor ADVERTISEMENT  
  
  
---------------------------------  
Yahoo! Groups Links  
  
 To visit your group on the web, go to:  
[http://groups.yahoo.com/group/psychtoolbox/](http://groups.yahoo.com/group/psychtoolbox/)  
  
 To unsubscribe from this group, send an email to:  
[psychtoolbox-unsubscribe@yahoogroups.com](mailto:psychtoolbox-unsubscribe@yahoogroups.com)  
  
 Your use of Yahoo! Groups is subject to the Yahoo!  
Terms of Service.  
  
  
  
  
  
  
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !   
Créez votre Yahoo! Mail sur [http://fr.mail.yahoo.com/](http://fr.mail.yahoo.com/)
