LineInCode

This program captures audio data and dumps it into its standard output (STDOUT).

It's intended to provide a way to encode a live stream from line-in or microphone with encoders which do not support it natively, but can receive raw PCM data from STDIN. The program has been tested with FLAC v1.10, OGG Vorbis v1.0, LAME v3.92 and Speex 1.0.0.

LineInCode is distributed under the GNU General Public License. The source code can be compiled with Borland Delphi or Freepascal.

Note that this program is no longer being developed. However people still seem to be using it (and it seems to work), so it is kept here for historical and other purposes.

LiveInCode: a GUI tool

Download

Usage

Run the program without parameters to get help. Make sure that LineInCode and the corresponging encoders are either in the current directory, or in directories listed on the environment PATH.

Ogg Vorbis

Make sure you have installed the Vorbis-Tools package.

For 44100 Hz Mono, low-bitrate VBR, run:

ogg44m -q 0

For 44100 Hz Stereo, high-quality VBR, run:

ogg44s -q 6

MP3(using LAME)

You should have the Lame encoder installed.

For 44100 Hz Mono, low-bitrate VBR, run

linco -B 16 -C 1 -R 44100 | lame –preset 48 -r -x -s 44.1 –bitwidth 16 -m m –strictly-enforce-ISO - -o out.mp3

For 44100 Hz Stereo, high-quality VBR, run

linco -B 16 -C 2 -R 44100 | lame -r -x -s 44.1 –bitwidth 16 –r3mix - out.mp3

I'd recommend finding out the satisfying command-line arguments and putting them into a batch file. That way you can save yourself from typing these long lines every time.

FLAC

Latest version of FLAC can be obtained here. Correct parameters for FLAC v1.10 were reported by Mike Connelly. Note that because encoder gets terminated with “Ctrl-C”, output file is not seekable, and the last frame is corrupted. 44100 Hz, Stereo:

linco -B 16 -C 2 -R 44100 | flac –endian=little –sign=signed –channels=2 –bps=16 –sample-rate=44100 - -o out.flac

Speex

Get the latest Speex from its official site. These command-lines work with version 1.0.0:

linco -B 8 -C 1 -R 16000 | speexenc -w –8bit - out.spxlinco -B 16 -C 1 -R 8000 | speexenc -n –16bit - out.spx

MusePack(.MPC)

Encoding into MusePack(.MPC) is not supported at the moment. MPPENC only accepts RIFF WAV data from StdIn, but not raw PCM. Either this program needs to be modified to output RIFF header, or the MPC encoder to accept raw data. I'd prefer the latter :-)

Scheduling example

Here's how one could use LineInCode and Windows scheduler to record a radio program:

INSTALL_-_BBC_WORLD_UPDATE.BAT:

at 5:00 /interactive /every:M,T,W,Th,F “d:\streams\schedule\rip_-_bbc_world_update.bat”

RIP_-_BBC_WORLD_UPDATE.BAT:

@echo off
d:
cd \streams
echo BBC World Update archiver
echo This program should be scheduled to run at 5am EST, Monday - Friday
linco -B 16 -C 1 -R 44100 -D 1:00:00 | flac –endian=little –sign=signed –channels=1 –bps=16 –sample-rate=44100 - -o bbc_world_update.flac %1 %2 %3 %4 %5 %6 %7 %8 %9

You can download these files in a single zip-archive.


lineincode.txt · Last modified: 2015-02-19 06:51 UTC by rm