9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Line-In
@ 2002-02-26 15:27 anothy
  2002-02-27 10:06 ` Don
  0 siblings, 1 reply; 5+ messages in thread
From: anothy @ 2002-02-26 15:27 UTC (permalink / raw)
  To: 9fans

from audio(3):
	Audio data is a sequence of stereo samples, left sample first.
	Each sample is a 16 bit little-endian two's complement
	integer; the default sampling rate is 44.1 kHz.
i'm not familiar with the term "cdr" as an audio format, but i'm
guessing you're refering to the audio format on a CD. that's PCM,
and yes, it's the same format you read/write on /dev/audio.

// I've tried using lame to convert P9 /dev/audio data to mp3...

one step at a time. can you get data from /dev/audio to start
with? just try 'cat /dev/audio > /tmp/foo', yell into the mic some,
and then kill the cat. the contents of /tmp/foo should be PCM
audio, suitable for 'cat /tmp/foo > /dev/audio'.

assuming you're getting audio data, are you sure lame is working?
i had issues with it producing valid but garbage mp3 files. for my
experiences, take a look at http://9srv.net/mpeg/ - the summary
is that i use BladeEnc quite succesfully. the single line to compile
it, and a binary in case you have problems, are available there.
ア



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Line-In
  2002-02-26 15:27 [9fans] Line-In anothy
@ 2002-02-27 10:06 ` Don
  0 siblings, 0 replies; 5+ messages in thread
From: Don @ 2002-02-27 10:06 UTC (permalink / raw)
  To: 9fans

> i'm not familiar with the term "cdr" as an audio format, but i'm
> guessing you're refering to the audio format on a CD. that's PCM,
> and yes, it's the same format you read/write on /dev/audio.
> 
Right on. I got the term "cdr" from the 'sox' manpage.

> // I've tried using lame to convert P9 /dev/audio data to mp3...
> 
> one step at a time. can you get data from /dev/audio to start
> with? just try 'cat /dev/audio > /tmp/foo', yell into the mic some,
> and then kill the cat. the contents of /tmp/foo should be PCM
> audio, suitable for 'cat /tmp/foo > /dev/audio'.
> 
Of course. 

> assuming you're getting audio data, are you sure lame is working?
> i had issues with it producing valid but garbage mp3 files. for my
> experiences, take a look at http://9srv.net/mpeg/ - the summary
> is that i use BladeEnc quite succesfully. the single line to compile
> it, and a binary in case you have problems, are available there.
> ?
Apparently the problem was that LAME and sox were not working. Though, I
find it odd, since, every file made on Linux/BSD will translate fine with
LAME/sox on my FreeBSD machine. :| That is why I thought the problem was
my understanding of the audio file format. Every mp3 file produced on 
Plan 9 ended up as pure garbage, though, a valid mp3 file was generated. 
Once I tried bladeenc on plan9 everything turned out sweet as cake ;)
Thanks,
Don (north_)
http://www.7f.no-ip.com/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Line-In
@ 2002-02-28 17:09 anothy
  0 siblings, 0 replies; 5+ messages in thread
From: anothy @ 2002-02-28 17:09 UTC (permalink / raw)
  To: 9fans

glad BladeEnc is working for you. as the page i
referenced notes, i think your results from LAME
match what i was seeing. rsc noted earlier that
LAME and /dev/audio disagree about byte order
in the samples; i've lost my LAME binary, so i
can't confirm that this makes my issue go away,
but if you have LAME around you could try the
command he posted:
	lame -v -rx -S --preset cd $i $i.mp3 && rm $i
and see if that produces more sensable mp3s. it'd
be nice to have both LAME and BladeEnc working,
since they're better at different things.
ア



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Line-In
@ 2002-02-26 16:35 Russ Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Russ Cox @ 2002-02-26 16:35 UTC (permalink / raw)
  To: 9fans

i use this command line with lame (which i call
games/mp3enc) and have no problems

games/mp3enc -v -rx -S --preset cd $i $i.mp3 && rm $i

somewhere on that line one of the flags swaps the
byte order of the samples.  /dev/audio and lame
disagree about the byte order.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9fans] Line-In
@ 2002-02-26 10:15 Don
  0 siblings, 0 replies; 5+ messages in thread
From: Don @ 2002-02-26 10:15 UTC (permalink / raw)
  To: 9fans

Hm, I have absolutely zero experience with sound relative 
to personal computers and their various formats (beyond 
cdr and mp3). Is there an existing way to feed in audio
data on Plan 9 thru 'Line In' and convert that data to
mp3 either during streaming or after the line-in data
has been saved to a file? I guess I am confused about
what format /dev/audio is in. My assumption from the 
data in the man page (3) is that its cdr format. Is
this correct? I've tried using lame to convert P9 
/dev/audio data to mp3 with no luck what-so-ever. 
Thx in advance :)
Don (north_)
http://www.7f.no-ip.com/


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-28 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-26 15:27 [9fans] Line-In anothy
2002-02-27 10:06 ` Don
  -- strict thread matches above, loose matches on Subject: below --
2002-02-28 17:09 anothy
2002-02-26 16:35 Russ Cox
2002-02-26 10:15 Don

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).