help-octave
[Top][All Lists]
Advanced

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

Re: Sound


From: Børge Strand
Subject: Re: Sound
Date: Fri, 7 Jul 2000 11:27:02 +0200 (MET DST)

Thanks for the quick replies, folks!

> > | But the basic approach would be to grab the vector, fopen/fwrite/fclose a
> > | temp file, and call system() with the correct magic incantation to play.
> > | Somebody out there may have already done this...
> > 
> > I think that's what Octave's playaudio function already does.

Snatched from the local Octave distribution:

  playaudio is the function defined from:
  /local/hacks/share/octave/2.0.8/m/audio/playaudio.m

   usage: playaudio (name [, ext])
        playaudio (X)

   `playaudio ("name" [, "ext"])' plays the audio file "name.ext". The
   default value for the "ext" argument, which has to be written
   without the initial ".", is "lin".
   Currently, the following audio formats are suppored:
   *) linear encoding with extension "lin" or "raw", played using
      /dev/dsp
   *) mu-law encoding with extension "mu", "au" or "snd", played
      using /dev/audio

   `playaudio (X)' plays the audio data contained in the vector X.


  Additional help for builtin functions, operators, and variables
  is available in the on-line version of the manual.


This looks fine, but does it allow specification of sampling frequency
and bits resolution?


> Well, I just used the source for playaudio, and it does the tmpfile
> shuffle, but it basically cats the result to /dev/dsp (for a vector) or
> /dev/audio (if possible, for a file).  There are, as JWE points out in the
> source, some limits to this approach.

I've been thinking about trying to use this on an old SGI setup (Which
is hardly mainstream, so if PC operation is the goal, that's okay with
me.) I looked at http://www.irisindigo.com/faq/audio to find that some
of this hardware does not support /dev/audio

So I guess what I'm trying to say is that there are different hardware
interfaces out there. And Octave might not want to be aware of them
all. The SoX homepage home.sprynet.com/~cbagwell/sox.html says

    Release Information

    Sox has been tested under Linux, SunOS, Solaris, and DOS and I have
    received success reports for various other platforms such as Irix and
    OS/2. I have had problems trying to compile and run it using Turbo C
    under DOS (16-bit mode) but it seems to work fine when compiled with
    cygwin32 (Win95/98/NT 32-bit mode).  

> But, I suspect that there would be an issue with making SoX Yet
> Another Dependency for building Octave.  

I'm new to the list, so I haven't got anything to say on this except
that maybe a dedicated sound package could depend on low-level audio
programs. 

-- 
Børge

P.S. Please correct me if this does not belong on the list.



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

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



reply via email to

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