Hello
Can anyone help me at all? I'm trying to work out how to encode directly to flac from the soundcard input (/dev/dsp) at the command line.
I found one site which suggested the following to encode from the sound card directly (/dev/dsp) into LAME;
Code:
$ sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ./test.mp3
That works for mp3s and lame, but I wanted to use it with flac instead. So I tried the following;
Code:
$ sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | flac --endian=little --sign=unsigned --channels=2 --bps=16 --sample-rate=44100 - -o output1
Which seemed to do something, but after recording I tried to use mplayer to play the file and got this;
Code:
$ mplayer output1
MPlayer 1.0rc1-3.4.6 (C) 2000-2006 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3200+ (Family: 15, Model: 47, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
Playing output1.
MPEG-PS file format detected.
VIDEO: MPEG1 3394x1825 (aspect 3) 24.000 fps 68490.8 kbps (8561.4 kbyte/s)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 3394 x 1825 (preferred colorspace: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try adding the scale filter, e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Unknown/missing audio format -> no sound
ADecoder init failed :(
Opening audio decoder: [libmad] libmad mpeg audio decoder
Cannot sync MAD frame
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [hwmpa] MPEG audio pass-through (fake decoder)
Cannot sync MPA frame: 0
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x50.
Read DOCS/HTML/en/codecs.html!
Audio: no sound
Starting playback...
FATAL: Could not initialize video filters (-vf) or video output (-vo).
Exiting... (End of file)
Mplayer seemed to completley mis-identify the file!
Xmms refused to play the file; xine randomly went from playing the file badly distorted to refusing to play it outright.
Both mplayer, xmms, xine and flac are all installed ok on my system. They work otherwise.
EDIT: Ne'er mind, I think I might have it ....
Code:
sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | flac --endian=little --sign=signed --channels=2 --bps=16 --sample-rate=44100 --force-raw-format - -o output1
Thanks
SP