|
For anyone else with this problem, a workaround that's not too bad is:
wavwrite(sig,fs,'temp.wav');
!afplay temp.wav
afplay is a command line soundfile player on OS X.
Cheers,
Aengus.
"Aengus " <aengus@ee.usyd.edu.au> wrote in message <hc3n1j$hkc$1@fred.mathworks.com>...
> Hi,
>
> Some additional information. This appears to be a problem with Java audio on the Mac.
>
> Some talk in these threads:
>
> http://discussions.apple.com/thread.jspa?messageID=10397960&tstart=0
> http://discussions.apple.com/thread.jspa?threadID=1250142&start=0&tstart=0
> http://lists.apple.com/archives/java-dev/2009/Oct/msg00151.html .
>
> At the suggestion of a poster in one of the threads, I got the buzzing to stop by running Applications/Utilities/Audio Midi Setup and setting the output audio sampling rate to 44100 Hz. This is only a temporary fix though, until another application changes the sample rate and things get messed up again.
>
> Even with the temporary fix, I still hear a click a few hundred milliseconds into the sound playback, which is not present when using other non-Java applications.
>
> I have seen mention of people going back to an earlier Java version. I don't know if this is a good idea or not... or how likely it is that there will be a proper fix soon.
>
> Cheers,
>
> Aengus.
>
>
>
> "Aengus " <aengus@ee.usyd.edu.au> wrote in message <hc3ih8$f94$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm having problems auditioning sound signals using the sound and soundsc functions in MATLAB 2009b on Mac Snow Leopard 10.6.1.
> >
> > I can run the following code to generate a 1 second 440 Hz sine wave at 48 kHz, scaled by 0.5:
> >
> > fs = 48000;
> > sig = 0.5*sin(2*pi*(0:(fs-1))*440/fs);
> >
> > But when I run the code:
> >
> > sound(sig,fs)
> >
> > I hear the signal I expect along with some bad buzzing-type artefacts. If I write the signal to a wave file ( using wavwrite(sig,fs,'test.wav') ) and audition it using other audio software on the computer, it sounds perfect.
> >
> > Has anyone any suggestions as to what might be going on?
> >
> > Thanks,
> >
> > Aengus.
|