help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOUND function and Macs


From: volker böhm
Subject: Re: SOUND function and Macs
Date: Thu, 29 Jul 2010 13:31:56 +0200

On 19.07.2010, at 00:23, Cary Martin wrote:

> Hello - I'm attempting to do some basic exploration of sound waveform
> analysis and manipulation using Octave and the Audio package. I
> apologize for such a newbie/ignorant question but if someone could
> please provide some assistance in configuring Octave and whatever
> external utilities are required to play sound files from Octave under
> Mac OsX 10.6.4 I would be greatly appreciative. I'm somewhat well
> versed in many of the basics of Octave but it is completely unclear to
> me what a pipe is in this context and how I am to establish the links
> to the external utilities (and to which ones). Anyway, when attempting
> to output a waveform to the speakers using this command
> 
> octave-3.2.2:10> sound(x,fs)
> 
> This response is received:
> 
> ssh: connect to host machine-mac-mini.local port 22: Connection refused
> warning: broken pipe -- some output may be lost

i had the same problem as you. as i'm still pretty new to octave myself, i 
might miss the point here, but
what seems to be going wrong (at least on my machine, which runs 10.6.4) is 
that the check in sound.m, 
if octave is run locally or not, fails.

if i run 
display=getenv("DISPLAY")
like in sound.m , i get
display = /tmp/launch-eHpt80/org.x:0
so, no hostname involved and the check fails.

i don't know how to fix this, but if you know that you run octave locally, then 
you might aswell skip the test altogether (e.g. comment it out) and simply set 
sound_play_utility to whatever you want. this works for me at least.

> 
> Can someone please point me in the right direction? It seemed that SoX
> is required so I've put in on my machine but I suspect that I'm
> missing something critical - can anyone help out?


actually you don't need sox, as the audio-package comes with a utility called 
ofsndplay (you have to compile it yourself, though), which seems to work fine 
and which sound.m tries to pipe its data to, if you are on mac.
but sox works fine, too. 
i've put it in /usr/local/bin and made a symlink "ln -s sox play".
now, from the terminal you can call 'play /my/sound.wav' to play a file.

to make this work with sound.m, simply put sound_play_utility = "play -" 
instead of "ofsndplay -" and octave should pipe to sox.
(don't forget to restart octave, if you make changes to sound_play_utility).

it is a hack, but it works here,
hth
volker.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]