help-octave
[Top][All Lists]
Advanced

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

Re: sound, and a looping thing


From: nwerneck
Subject: Re: sound, and a looping thing
Date: Wed, 26 Nov 2003 17:29:57 -0200
User-agent: Mutt/1.3.28i

On Wed, Nov 26, 2003 at 07:16:22PM -0000, Crispin wrote:
> 1. the playaudio() function works for the default of 8 bit 8kHz audio.
> Is there any way of playing other formats (say, 16 bit 44kHz)?  ...or
> should I get coding?
When I want to play a vector from Octave I run this little script to
call PLAY in the shell, reading a named pipe, and write to it.

function toca(SS)
        system("play -r44100 -tsw -c1 som&");
        som = fopen("som", "w");
        fwrite (som, SS, "short");
        fclose(som);
endfunction;
                                
You can call play from the command line in an infinite loop also, for
example... It doesn't work cleanly, but it's not bad for me to work this
way.

I don't  think  there is a better way to do things also! :) I don't like
to see the huge programs people sometimes use to do this... What do they
do after all!?

Of course, if you are using windows it may be difficult to do this.


-- 
Nicolau Werneck <address@hidden>         9F99 25AB E47E 8724 2F71
http://cefala.org/~nwerneck                   EA40 DC23 42CE 6B76 B07F
"After silence, that which comes nearest to expressing the inexpressible is 
music."
-- Aldous Huxley



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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