[Flac] Encoding Streaming Audio -- Possible?

Brian Willoughby brianw at sounds.wa.com
Wed Mar 30 19:03:55 PST 2005


FLAC is a collection of both programming libraries and user programs.

As a programming library, FLAC most certainly supports writing both files  
and/or various kinds of streams from any incoming audio.  However, FLAC does  
not contain code to read every kind of input, so support for getting the audio  
from the radio requires additional code.

The FLAC user programs generally read pre-existing files, since that is  
something which is available on every system.  As Josh points out, they also  
accept data from stdin, meaning that another program which reads audio can feed  
it to the FLAC user program using a Unix "pipe."  In this kind of pipe, the  
data is not keyboard input, because it contains data that could not be typed  
in.

Without writing code, you'll need to find a program that can get audio data  
from the radio and send it to stdout.  If you can find something that does  
this, then you can use bash to pipe that output into the FLAC user program.

Otherwise, you'll need to write your own program that reads audio data from  
the radio and creates a FLAC file to save the encoded data.  The FLAC libraries  
make this *very* easy to do.  But you need to find code that will read audio  
data from the radio.  Most developer example collections include sample code  
that could read live audio data from a Soundblaster.

Good luck finding what you need!

Brian Willoughby
Sound Consulting


Begin forwarded message:

> --- Hal Vaughan <hal at thresholddigital.com> wrote:
> > I've been reading the info on Sourceforge about Flac, but there's one
> > thing I'm not clear about (and it looks like Flac may not support
> > this yet).  Before I installed it, I wanted to know if Flac would do
> > what I need.
> >
> > I want to be able to record shows on the radio (I have a radio hooked
> > up to my Soundblaster Live!).  From what I've read, Flac doesn't do
> > that, since it seems it only encodes from pre-existing files.
> >
> > Is this right, or can I use Flac to encode the incoming signal from
> > the radio and store it in a file?
>
> it can record from stdin.

I'm confused.  I saw this mentioned somewhere, but I don't understand how you
can send an audio stream through stdin -- we are talking stdin, as in what is
usually keyboard input from bash.  Any suggestions on a good place to learn
more about this?


More information about the Flac mailing list