Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 1998 11:08:21 -0700 (PDT)
From:      Archie Cobbs <archie@whistle.com>
To:        zach@gaffaneys.com (Zach Heilig)
Cc:        luigi@labinfo.iet.unipi.it, zach@gaffaneys.com, freebsd-multimedia@FreeBSD.ORG
Subject:   Re: (oops!) converting sound from /dev/audio format to /dev/dsp
Message-ID:  <199809181808.LAA18463@bubba.whistle.com>
In-Reply-To: <19980918123025.A697@znh.org> from Zach Heilig at "Sep 18, 98 12:30:25 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Zach Heilig writes:
> The problem is: I now have two formats of files... linear seems to be much
> easier to work on (when I'm writing the filter programs -- I figured out
> linear by looking at a graph of part of a file, ulaw is not as obvious).

Below is a short C file that converts between linear and u-law.
It's handy if you just need to do that, rather than installing sox.
I snarfed it off the net somewhere once.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

begin 664 ulaw.c.gz
M'XL(`&NA`C8"`^V87V_;1A;%GZ5/<38%%I8KV1R2(JDX">#*3J&%DP:V-P^[
M"`Q:&MD$*%(5J29&_WSVWCMSJ#!%$?2M+S4!CTB>>V;NG9D?*0U/CX<XQK[,
M/YXLY=/I</A-42W+_<KB1?/4G+9/6]N</+X:#KUR\?;V\OKM^17>GU\OSK^[
MNKSQ44#3YFVQQ+*NFA9%U9KDKG7&=VU^7]K_A]/D`U[B9Y$"DR@T83R6UI@@
MT#8(TD3:<!9,0VVS(,RT38-`=>%TEJDNC&?39.P]PF@6.:T$.:W),J<-LD2U
M9I9%ZBF7C>I,FF:J,TF:Q/0PT]G,:::QBS7Q+'7:./8>T2QV,5'LO<*9&[>,
M7CSI868N!V,B[Q]D+A<31-*/"&:9YB1M%`?:9IGF)FUDF`LFJ<M%VD1CI8U#
MITV-]TA<CM(FWBN)9DZ7&/&DQ]3E+VWB_:=1ZK138YPV=G61-@F<+HYBIXN#
M6=AY1"X7:5,?*RDX;33U'I'+42?0>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;;5ZM-.FK_./X&=X792DC;<=X4RP?
M;3GN`FV+O#R1G-((B\O+2RRJ]D3MUB>07L1HLZ^*I>NS&>-]7<(<@C5JC.V#
MQ)L3$T[T?ZHWHQ'>+*XF-[<7^LJ@[V#C9PNM>2T3DM\79=$^00:(=W8GN6UR
M*2%N6KF2[U9-9Z]9GU=Y63],VOJNJ\K<K81&:W`H4#-^=AA3BM?V?K?/I=0R
M4REG:E')(GB.F^*ALBM9B+@OVFX9-;F65E4_[%LGR]QM75N'F_H2OK)K78O_
MN[S^X?;Z_)UV=WJ,=K^KM%;MHT6[R[?(&TB:[IQ5T+?Q+OJ[Q?D-@D]9[*-Y
M5<7Y:C4I*NE:##1WCM*/H.E[S*\6[Q36T70XW-\M'_/=\+\R6&X@><]GT&CX
M\Q^_!*AX8#]M[\I]^^7K?S`.QD:.D$?TA\.)XO'7#R>:CK]^_'51,O[Z\7>(
MTO'7CW]$GNK0+YR#P:"1/3>&++FZ$GJ-(;N]+9HF5X5?O!@,=*_=/[7V3+^U
MRK;X7L"D>\*O8W6JH4:33?Y0%:U\%3[1#0%W49;P$86O7B$;X=^ZP8(SZ5RL
M&F5<4ZS\)G-Z%UFL<>1/__42`49=7R\Q\9_.7/B#A!\Z[4>R0[\9>]%Z[D.7
M9;%UG7X1[Q/T&&O]\^Q+'G6/-2;8^?+#MXX@6KRNI'*OV]"?A_4**7PA7K_^
MH.JN[%JLGNKHL\VWB"3$!P6OW?1P5B3FMZY8O_1#7KQ`+!&_?'8?G0V_*=;"
MJ0,F6;#/7E+MD5M&/7OI,=3YTK+56WW:*.K=P]0Q5>$GS]-B+8'R'!/D'@RE
MQU^[7T*4@A>6KQ'P/XXX\@_V$Z6Y=81<0>/T)H$_^-/GPD]YN;?^EQ19?\.>
9-Y?M)\_7WGCXL\JG#WY0OP/<G3+ARA$``./T
`
end

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809181808.LAA18463>