Octave audio hack

David Kuehling dvdkhlng at gmx.de
Mon Nov 7 11:28:48 EST 2011

>>>>> "cenobyte" == cenobyte  <cenobyte at dragoncrypt.com> writes:

> I was looking in my laptop repos and found the package octave-audio
> which lets you record and plot audio from within Octave and thought it
> might be cool to get this working on the Ben as a sort of Audacity
> replacement (of course less features)

Note that you can easily do audio-processing from Octave without
octave-audio.  Use popen() to open a pipe to the 'sox' program with
'sox' passing raw sample data to/from octave.  Then use 'fread()' to
read the sample data.

Here is an example octave script I created a few years back:


It reads a wave file, searches for a certain 'beep' sound (given by the
'sepfile' argument), and cuts the input wave file into pieces whenever
the 'beep' is found.  It inputs and outputs wave files via popen&sox.
If you slightly change the sox command line you could also input/output
directly from the linux audio driver (try "-t ossdsp /dev/dsp", maybe it
also supports ALSA?).


GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.en.qi-hardware.com/pipermail/discussion/attachments/20111107/e24dffdf/attachment.pgp>

More information about the discussion mailing list