LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-20-2007, 01:35 PM   #1
slothpuck
Member
 
Registered: Jul 2003
Distribution: Slackware 10.2 / Slamd 64
Posts: 86

Rep: Reputation: 15
Encoding directly to FLAC


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

Last edited by slothpuck; 08-20-2007 at 02:26 PM.
 
Old 08-21-2007, 12:15 PM   #2
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Rep: Reputation: 31
Might you have forgotten to add the extension (.flac)? Otherwise check the options, I'm not familiar with flac ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FLAC to MP3 General Linux - Software 3 12-28-2009 06:43 AM
flac to ogg and mp3 DJOtaku Linux - General 4 09-28-2005 05:24 PM
MDK9.2 and flac Sjaak Mandriva 2 10-08-2004 08:58 PM
flac sethgeekx86 Linux - Newbie 1 02-15-2004 06:15 PM
Encoding directly from CD LittleJohn Linux - General 4 01-15-2004 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration