public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* alsa and sox questions
@  Gregory Nowak
   ` Geoff Shang
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

Hi all,

I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.

I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me. 

Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?

Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels? 

Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
Greg



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

* Re: alsa and sox questions
   alsa and sox questions Gregory Nowak
@  ` Geoff Shang
     ` Gregory Nowak
     ` Kerry Hoath
   ` Cheryl Homiak
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 22+ messages in thread
From: Geoff Shang @  UTC (permalink / raw)
  To: speakup

Hi:

firstly Greg, FTP directories sort alphabetically.  therefore, beta11 and
beta12 are going to be before beta2.

As for splitting the channels off a wave file, you can do this with the agc
effect.  If memory serves, the syntax is:

sox <infile> <outfile> agc -l  (or -r)

for more info check out the sox manpage.  You can also use arecord in the
0.9x series to record each channel to a seperate file, using the -I switch
(I think).  I've not used this though.

Geoff.


-- 
Geoff Shang <gshang@uq.net.au>
ICQ number 43634701

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html




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

* Re: alsa and sox questions
   alsa and sox questions Gregory Nowak
   ` Geoff Shang
@  ` Cheryl Homiak
   ` Charles Hallenbeck
   ` Kerry Hoath
  3 siblings, 0 replies; 22+ messages in thread
From: Cheryl Homiak @  UTC (permalink / raw)
  To: speakup

Hi greg and all!
No, actually, there's a beta12. Though I've had it with alsa for the time being!

Just go to www.alsa-project.org and in that main site arrow clear down till you
get to it or do a slash and look for beta12
Actually, if you are in lynx it's about link 29 that they start and go through
32; of course, the links take you to the ftp site but it's easier for me to tell
you how to do it this way.
Have fun!!!



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

* Re: alsa and sox questions
   ` Geoff Shang
@    ` Gregory Nowak
       ` Charles Hallenbeck
     ` Kerry Hoath
  1 sibling, 1 reply; 22+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

Thanks Geoff. However, the sad news is that I still can't get arecord to work. I posted the error I get to the list a while back. The same is true for aplay. Rec does work, but there is silence when the recorded file is played back. Thanks again for the sox info.
Greg



On Fri, Mar 29, 2002 at 02:28:31PM +1000, Geoff Shang wrote:
> Hi:
> 
> firstly Greg, FTP directories sort alphabetically.  therefore, beta11 and
> beta12 are going to be before beta2.
> 
> As for splitting the channels off a wave file, you can do this with the agc
> effect.  If memory serves, the syntax is:
> 
> sox <infile> <outfile> agc -l  (or -r)
> 
> for more info check out the sox manpage.  You can also use arecord in the
> 0.9x series to record each channel to a seperate file, using the -I switch
> (I think).  I've not used this though.
> 
> Geoff.
> 
> 
> -- 
> Geoff Shang <gshang@uq.net.au>
> ICQ number 43634701
> 
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.fsf.org/philosophy/no-word-attachments.html
> 
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


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

* Re: alsa and sox questions
   alsa and sox questions Gregory Nowak
   ` Geoff Shang
   ` Cheryl Homiak
@  ` Charles Hallenbeck
     ` jwantz
   ` Kerry Hoath
  3 siblings, 1 reply; 22+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup

Greg -
The alsa 0.9.0beta11 archives are there where the others are, but
since they are placed in alphabetical order they are not near the
end of the list. Use the Lynx search command to search for
"beta11" and you will find them.

The alsa "arecord" command will generate two files from a stereo
source if you want it to, one for the left and one for the right.
It appends a ".0" to one and a ".1" to the other. They seem to be
".raw" files rather than ".wav" but you can easily convert them
with sox.

HTH - Chuck


On Thu, 28 Mar 2002, Gregory Nowak wrote:

> Hi all,
>
> I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
>
> I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me.
>
> Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
>
> Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels?
>
> Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> Greg
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

Visit me at http://www.valstar.net/~hallenbeck
The Moon is Waning Gibbous (99% of Full)



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

* Re: alsa and sox questions
     ` Gregory Nowak
@      ` Charles Hallenbeck
         ` Gregory Nowak
  0 siblings, 1 reply; 22+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup

Greg -

My arecord and aplay work fine. What kind of errors do you get?
What parameters do you use? What version? It is a little
irritating that the syntax seems to change regularly on those
commands with each update, so if you are using parameters that
used to work on an earlier version, check out the man page
carefully for changes, especially capitalization!

Chuck

On Thu, 28 Mar 2002, Gregory Nowak wrote:

>
> Thanks Geoff. However, the sad news is that I still can't get arecord to work. I posted the error I get to the list a while back. The same is true for aplay. Rec does work, but there is silence when the recorded file is played back. Thanks again for the sox info.
> Greg
>
>
>
> On Fri, Mar 29, 2002 at 02:28:31PM +1000, Geoff Shang wrote:
> > Hi:
> >
> > firstly Greg, FTP directories sort alphabetically.  therefore, beta11 and
> > beta12 are going to be before beta2.
> >
> > As for splitting the channels off a wave file, you can do this with the agc
> > effect.  If memory serves, the syntax is:
> >
> > sox <infile> <outfile> agc -l  (or -r)
> >
> > for more info check out the sox manpage.  You can also use arecord in the
> > 0.9x series to record each channel to a seperate file, using the -I switch
> > (I think).  I've not used this though.
> >
> > Geoff.
> >
> >
> > --
> > Geoff Shang <gshang@uq.net.au>
> > ICQ number 43634701
> >
> > Please avoid sending me Word or PowerPoint attachments.
> > See http://www.fsf.org/philosophy/no-word-attachments.html
> >
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

Visit me at http://www.valstar.net/~hallenbeck
The Moon is Waning Gibbous (99% of Full)



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

* Re: alsa and sox questions
   alsa and sox questions Gregory Nowak
                   ` (2 preceding siblings ...)
   ` Charles Hallenbeck
@  ` Kerry Hoath
     ` Gregory Nowak
  3 siblings, 1 reply; 22+ messages in thread
From: Kerry Hoath @  UTC (permalink / raw)
  To: speakup

Yes you can do channel fiddling I do this when I am copying 4-track tapes.
You use the pick effect to split out a channel like this:
sox stereo.wav -c1 mono_left.wav pick -l
sox stereo.wav -c1 mono-right.wav pick -r
You need the -c 1  to tell sox to o nly write 1 channel to the output.
If you have a mono wav you _can_ duplicate the left channel like this:
sox mono.wav -c2 stereo.wav
but mono plays in the center of the stereo image and you are simply duplicating data.
The only reason I can see for wanting to turn mon into stereo is if you have
some high quality mono samples you want to play on an audio cd that wants stereo data.
I had to do this with some mono minidiscs so they'd play on a normal cd player without
leaving the right channel silent or playing at the worng sample rate.

Regards, Kerry.
On Thu, Mar 28, 2002 at 10:17:06PM -0600, Gregory Nowak wrote:
> Hi all,
> 
> I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> 
> I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me. 
> 
> Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> 
> Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels? 
> 
> Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> Greg
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 

-- 
Kerry Hoath:  kerry@gotss.net kerry@gotss.eu.org or  kerry@gotss.spice.net.au
ICQ: 8226547 msn: kerry@gotss.net Yahoo: kerryhoath@yahoo.com.au


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

* Re: alsa and sox questions
   ` Geoff Shang
     ` Gregory Nowak
@    ` Kerry Hoath
       ` Geoff Shang
  1 sibling, 1 reply; 22+ messages in thread
From: Kerry Hoath @  UTC (permalink / raw)
  To: speakup

My sox does not have agc, this is version 12.17.3.
It has avg but that is for merging channels.
On Fri, Mar 29, 2002 at 02:28:31PM +1000, Geoff Shang wrote:
> Hi:
> 
> firstly Greg, FTP directories sort alphabetically.  therefore, beta11 and
> beta12 are going to be before beta2.
> 
> As for splitting the channels off a wave file, you can do this with the agc
> effect.  If memory serves, the syntax is:
> 
> sox <infile> <outfile> agc -l  (or -r)
> 
> for more info check out the sox manpage.  You can also use arecord in the
> 0.9x series to record each channel to a seperate file, using the -I switch
> (I think).  I've not used this though.
> 
> Geoff.
> 
> 
> -- 
> Geoff Shang <gshang@uq.net.au>
> ICQ number 43634701
> 
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.fsf.org/philosophy/no-word-attachments.html
> 
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 

-- 
Kerry Hoath:  kerry@gotss.net kerry@gotss.eu.org or  kerry@gotss.spice.net.au
ICQ: 8226547 msn: kerry@gotss.net Yahoo: kerryhoath@yahoo.com.au


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

* Re: alsa and sox questions
   ` Charles Hallenbeck
@    ` jwantz
       ` Charles Hallenbeck
  0 siblings, 1 reply; 22+ messages in thread
From: jwantz @  UTC (permalink / raw)
  To: speakup

Hi Chuck,
I really haven't tried this, but what's wrong with the -w switch?  
Wouldn't that force wave files 

     Jim WantzOn Fri, 29 Mar 2002, Charles Hallenbeck 
wrote:

> Greg -
> The alsa 0.9.0beta11 archives are there where the others are, but
> since they are placed in alphabetical order they are not near the
> end of the list. Use the Lynx search command to search for
> "beta11" and you will find them.
> 
> The alsa "arecord" command will generate two files from a stereo
> source if you want it to, one for the left and one for the right.
> It appends a ".0" to one and a ".1" to the other. They seem to be
> ".raw" files rather than ".wav" but you can easily convert them
> with sox.
> 
> HTH - Chuck
> 
> 
> On Thu, 28 Mar 2002, Gregory Nowak wrote:
> 
> > Hi all,
> >
> > I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> >
> > I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me.
> >
> > Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> >
> > Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels?
> >
> > Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> > Greg
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> 
> Visit me at http://www.valstar.net/~hallenbeck
> The Moon is Waning Gibbous (99% of Full)
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 



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

* Re: alsa and sox questions
     ` jwantz
@      ` Charles Hallenbeck
         ` jwantz
  0 siblings, 1 reply; 22+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup

I tried that, Jim, but I still got raw files. I have not played
with it a lot myself, so perhaps I screwed it up while checking
it out or something. I went to the beta11 version of alsa because
the last time I looked there had not been a beta12 version of the
alsa OSS package posted.

Chuck


On Fri, 29 Mar 2002 jwantz@hpcc2.hpcc.noaa.gov wrote:

> Hi Chuck,
> I really haven't tried this, but what's wrong with the -w switch?
> Wouldn't that force wave files
>
>      Jim WantzOn Fri, 29 Mar 2002, Charles Hallenbeck
> wrote:
>
> > Greg -
> > The alsa 0.9.0beta11 archives are there where the others are, but
> > since they are placed in alphabetical order they are not near the
> > end of the list. Use the Lynx search command to search for
> > "beta11" and you will find them.
> >
> > The alsa "arecord" command will generate two files from a stereo
> > source if you want it to, one for the left and one for the right.
> > It appends a ".0" to one and a ".1" to the other. They seem to be
> > ".raw" files rather than ".wav" but you can easily convert them
> > with sox.
> >
> > HTH - Chuck
> >
> >
> > On Thu, 28 Mar 2002, Gregory Nowak wrote:
> >
> > > Hi all,
> > >
> > > I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> > >
> > > I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me.
> > >
> > > Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> > >
> > > Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels?
> > >
> > > Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> > > Greg
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> > Visit me at http://www.valstar.net/~hallenbeck
> > The Moon is Waning Gibbous (99% of Full)
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

Visit me at http://www.valstar.net/~hallenbeck
The Moon is Waning Gibbous (99% of Full)



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

* Re: alsa and sox questions
       ` Charles Hallenbeck
@        ` jwantz
           ` Geoff Shang
  0 siblings, 1 reply; 22+ messages in thread
From: jwantz @  UTC (permalink / raw)
  To: speakup

Hi Chuck,
Interesting.  I reverted back to 5.12 because the driver for my card 
(AWE64) is broken in the beta versions.

     Jim Wantz
On Fri, 29 Mar 2002, Charles 
Hallenbeck wrote:

> I tried that, Jim, but I still got raw files. I have not played
> with it a lot myself, so perhaps I screwed it up while checking
> it out or something. I went to the beta11 version of alsa because
> the last time I looked there had not been a beta12 version of the
> alsa OSS package posted.
> 
> Chuck
> 
> 
> On Fri, 29 Mar 2002 jwantz@hpcc2.hpcc.noaa.gov wrote:
> 
> > Hi Chuck,
> > I really haven't tried this, but what's wrong with the -w switch?
> > Wouldn't that force wave files
> >
> >      Jim WantzOn Fri, 29 Mar 2002, Charles Hallenbeck
> > wrote:
> >
> > > Greg -
> > > The alsa 0.9.0beta11 archives are there where the others are, but
> > > since they are placed in alphabetical order they are not near the
> > > end of the list. Use the Lynx search command to search for
> > > "beta11" and you will find them.
> > >
> > > The alsa "arecord" command will generate two files from a stereo
> > > source if you want it to, one for the left and one for the right.
> > > It appends a ".0" to one and a ".1" to the other. They seem to be
> > > ".raw" files rather than ".wav" but you can easily convert them
> > > with sox.
> > >
> > > HTH - Chuck
> > >
> > >
> > > On Thu, 28 Mar 2002, Gregory Nowak wrote:
> > >
> > > > Hi all,
> > > >
> > > > I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> > > >
> > > > I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me.
> > > >
> > > > Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> > > >
> > > > Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels?
> > > >
> > > > Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> > > > Greg
> > > >
> > > >
> > > > _______________________________________________
> > > > Speakup mailing list
> > > > Speakup@braille.uwo.ca
> > > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > > >
> > >
> > > Visit me at http://www.valstar.net/~hallenbeck
> > > The Moon is Waning Gibbous (99% of Full)
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> 
> Visit me at http://www.valstar.net/~hallenbeck
> The Moon is Waning Gibbous (99% of Full)
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 



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

* Re: alsa and sox questions
       ` Charles Hallenbeck
@        ` Gregory Nowak
           ` Charles Hallenbeck
  0 siblings, 1 reply; 22+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

Right now, I'm using 0.90 beta 8, although I was using 0.90 beta 9 with the same results before I decided to see if down grading would help. I will of course upgrade to beta 11 when I have the time, since I now know how to find it. I'm including a script of how I envoke arecord, and what happens. I should also add that the same exact thing happens with aplay, although play works just fine, and so do the other sound programs I have on here such as trplayer. The card I'm using is a sblive if it makes a difference.


Script started on Fri Mar 29 14:47:02 2002
root@linserver:~# arecord test.wav
ALSA lib pcm_hw.c:593:(snd_pcm_hw_open) SNDRV_PCM_IOCTL_PVERSION failed: Inappropriate ioctl for device
arecord: main:446: audio open error: Inappropriate ioctl for device
root@linserver:~# cd /startup
root@linserver:/startup# aplay startup.au
ALSA lib pcm_hw.c:593:(snd_pcm_hw_open) SNDRV_PCM_IOCTL_PVERSION failed: Inappropriate ioctl for device
aplay: main:446: audio open error: Inappropriate ioctl for device
root@linserver:/startup# exit
Script done on Fri Mar 29 14:47:53 2002


Greg


On Fri, Mar 29, 2002 at 06:38:22AM -0500, Charles Hallenbeck wrote:
> Greg -
> 
> My arecord and aplay work fine. What kind of errors do you get?
> What parameters do you use? What version? It is a little
> irritating that the syntax seems to change regularly on those
> commands with each update, so if you are using parameters that
> used to work on an earlier version, check out the man page
> carefully for changes, especially capitalization!
> 
> Chuck
> 
> On Thu, 28 Mar 2002, Gregory Nowak wrote:
> 
> >
> > Thanks Geoff. However, the sad news is that I still can't get arecord to work. I posted the error I get to the list a while back. The same is true for aplay. Rec does work, but there is silence when the recorded file is played back. Thanks again for the sox info.
> > Greg
> >
> >
> >
> > On Fri, Mar 29, 2002 at 02:28:31PM +1000, Geoff Shang wrote:
> > > Hi:
> > >
> > > firstly Greg, FTP directories sort alphabetically.  therefore, beta11 and
> > > beta12 are going to be before beta2.
> > >
> > > As for splitting the channels off a wave file, you can do this with the agc
> > > effect.  If memory serves, the syntax is:
> > >
> > > sox <infile> <outfile> agc -l  (or -r)
> > >
> > > for more info check out the sox manpage.  You can also use arecord in the
> > > 0.9x series to record each channel to a seperate file, using the -I switch
> > > (I think).  I've not used this though.
> > >
> > > Geoff.
> > >
> > >
> > > --
> > > Geoff Shang <gshang@uq.net.au>
> > > ICQ number 43634701
> > >
> > > Please avoid sending me Word or PowerPoint attachments.
> > > See http://www.fsf.org/philosophy/no-word-attachments.html
> > >
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
> 
> Visit me at http://www.valstar.net/~hallenbeck
> The Moon is Waning Gibbous (99% of Full)
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


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

* Re: alsa and sox questions
   ` Kerry Hoath
@    ` Gregory Nowak
       ` Igor Gueths
       ` Kerry Hoath
  0 siblings, 2 replies; 22+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

Thanks. One more question that came to me is what's the best way to set the volume on the card line in jack, and on the tape player, so that the sound quality is just right. The reason I'm asking this is because my choice seems to be only to wire the line in of the card to the headphone jack of the tape player.
Greg


On Fri, Mar 29, 2002 at 07:53:14PM +0800, Kerry Hoath wrote:
> Yes you can do channel fiddling I do this when I am copying 4-track tapes.
> You use the pick effect to split out a channel like this:
> sox stereo.wav -c1 mono_left.wav pick -l
> sox stereo.wav -c1 mono-right.wav pick -r
> You need the -c 1  to tell sox to o nly write 1 channel to the output.
> If you have a mono wav you _can_ duplicate the left channel like this:
> sox mono.wav -c2 stereo.wav
> but mono plays in the center of the stereo image and you are simply duplicating data.
> The only reason I can see for wanting to turn mon into stereo is if you have
> some high quality mono samples you want to play on an audio cd that wants stereo data.
> I had to do this with some mono minidiscs so they'd play on a normal cd player without
> leaving the right channel silent or playing at the worng sample rate.
> 
> Regards, Kerry.
> On Thu, Mar 28, 2002 at 10:17:06PM -0600, Gregory Nowak wrote:
> > Hi all,
> > 
> > I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> > 
> > I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me. 
> > 
> > Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> > 
> > Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels? 
> > 
> > Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> > Greg
> > 
> > 
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > 
> 
> -- 
> Kerry Hoath:  kerry@gotss.net kerry@gotss.eu.org or  kerry@gotss.spice.net.au
> ICQ: 8226547 msn: kerry@gotss.net Yahoo: kerryhoath@yahoo.com.au
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


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

* Re: alsa and sox questions
     ` Gregory Nowak
@      ` Igor Gueths
       ` Kerry Hoath
  1 sibling, 0 replies; 22+ messages in thread
From: Igor Gueths @  UTC (permalink / raw)
  To: speakup

Hi Greg. One thing you can do is make sure the mixer settings on your card unmute line and make sure that line-in levels are up to a good level, then turn up the sound on the tape recorder until it clips and distorts. Then turn the volume back down slightly, and you should get a good recording level. I used to do this when recording tapes, and it worked great for me. 
----- Original Message ----- 
From: Gregory Nowak <gnowak1@uic.edu>
To: <speakup@braille.uwo.ca>
Sent: Friday, March 29, 2002 3:59 PM
Subject: Re: alsa and sox questions


> Thanks. One more question that came to me is what's the best way to set the volume on the card line in jack, and on the tape player, so that the sound quality is just right. The reason I'm asking this is because my choice seems to be only to wire the line in of the card to the headphone jack of the tape player.
> Greg
> 
> 
> On Fri, Mar 29, 2002 at 07:53:14PM +0800, Kerry Hoath wrote:
> > Yes you can do channel fiddling I do this when I am copying 4-track tapes.
> > You use the pick effect to split out a channel like this:
> > sox stereo.wav -c1 mono_left.wav pick -l
> > sox stereo.wav -c1 mono-right.wav pick -r
> > You need the -c 1  to tell sox to o nly write 1 channel to the output.
> > If you have a mono wav you _can_ duplicate the left channel like this:
> > sox mono.wav -c2 stereo.wav
> > but mono plays in the center of the stereo image and you are simply duplicating data.
> > The only reason I can see for wanting to turn mon into stereo is if you have
> > some high quality mono samples you want to play on an audio cd that wants stereo data.
> > I had to do this with some mono minidiscs so they'd play on a normal cd player without
> > leaving the right channel silent or playing at the worng sample rate.
> > 
> > Regards, Kerry.
> > On Thu, Mar 28, 2002 at 10:17:06PM -0600, Gregory Nowak wrote:
> > > Hi all,
> > > 
> > > I've been reading here recently that people have been installing alsa 0.90 beta 11. Where did all of you get that from? The newest thing on the alsa-project.org ftp site is still 0.90 beta 9.
> > > 
> > > I also have a sox question. As we know, most audio tapes are recorded to play through both left and right speakers. I think this is defined as left and right channels, but if this isn't correct, please assume that it is throughout this post. Based on reading the sox man page, I think I can do the following, but I need someone to reassure me. 
> > > 
> > > Say again that I have a standard audio tape recorded with left and right channels. Is there a way for me to strip one of the channels from a wave file recording of that tape using sox? What I'm asking is if I record this tape as a wave file, can I then strip either the left or right channels from this recording?
> > > 
> > > Alternatively, let's say that I already have a wave recording where one of the channels has already been stripped, which leaves me with a left channel only from the original tape. Can I use sox to mix the data on that left channel into both a left and right channels? 
> > > 
> > > Please forgive the weirdness of theese questions. However, I really do not care to elaborate why I'm asking them. Yes, it is for a purpose, and depending on what answers I get, I may or may not do what I'm planning, it really is a long story. Thanks for bearing with me, and for any help in advance.
> > > Greg
> > > 
> > > 
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > > 
> > 
> > -- 
> > Kerry Hoath:  kerry@gotss.net kerry@gotss.eu.org or  kerry@gotss.spice.net.au
> > ICQ: 8226547 msn: kerry@gotss.net Yahoo: kerryhoath@yahoo.com.au
> > 
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



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

* Re: alsa and sox questions
         ` Gregory Nowak
@          ` Charles Hallenbeck
             ` Gregory Nowak
  0 siblings, 1 reply; 22+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup

Greg -
Your example showed that you did not use any parameters with the
arecord command at all. No wonder it did not work!

I will include below a script which I use to record wav files but
first I will talk about it.

The script contains some statements that let you use "ctrl-c" to
interrupt a running program without interrupting the script
itself. The reason is that I want to run arecord for an
indefinite amount of time and interrupt it when the work is done,
but I want the script to continue.
When the recording is complete, I want to use sox to copy it to
my home directory from the /tmp directory where it was created,
so that sox can fix the length parameter in the RIFF header as a
by-product.
The script is called "rec22km" which means 22k sampling rate and
mono format. I have other scripts for 22k stereo and other
speeds, Mono and stereo. All the scripts produce 16 bit signed
samples.
The script can be run just by typing the script name, in which
case the resulting file in your home directory will be
"rec22km.wav", or you can include a name such as "myvoice" on the
command line: "rec22km myvoice" and the resulting file in your
home directory will be called "myvoice.wav".
Once the copying is complete, the file is played just for kicks,
and to verify that it worked. You can also interrupt the play
command with ctrl-c and the script survives so that it can remove
the /tmp file before exiting.

The parameters on the arecord command are what you have failed to
include. I use "-d 7200" to allow a ridiculously long duration.
This parameter was optional in earlier versions, but somewhere
along the way the default duration became "0 seconds" so you have
to give it a positive value.
I use "-q" to throw away the reporting messages.
I use "-r 22050" to set the sampling rate.
I use "-f S16_LE" to specify the format of the output file:
S16_LE means "signed 16 bit little endian". This parameter has
changed regularly with each upgrade and is a pain in the ass to
keep track of when you upgrade.
I use the "-c1" parameter to specify one channel (i.e., monaural)
and a space between the 'c' and the '1' is permitted but not
required.
Finally comes the file name.
The trailing ')' on the arecord line of the script below belongs
to the subshell interruption control from the previous line.

Sorry this has been so complicated, but once you get it going it
works like a charm. Of course you must be sure you have enable
'capture' on the input source you want to record (you cannot just
set your speaker level, since that is not the signal that gets
recorded). For example you would want to mute your mike channel
or turn the speaker volume off, but enable capture on the mike
channel and adjust the capture volume appropriately. I have to
use different capture volume settings for mike, CD, and Line, but
once they are set, arecord works like a charm for me.

Here is the script:
-------------
#!/bin/bash
trap "" SIGINT # ignore ^C
(trap - SIGINT # except in this subshell
arecord -d 7200 -q -r 22050 -f S16_LE -c1 /tmp/rec22km.wav )
echo wait...
if [ "$1" = "" ]; then
sox /tmp/rec22km.wav rec22km.wav >/dev/null 2>&1
echo rec22km.wav
(trap - SIGINT # except in this subshell
play rec22km.wav )
else
sox /tmp/rec22km.wav $1.wav >/dev/null 2>&1
echo $1.wav
(trap - SIGINT # except in this subshell
play $1.wav )
fi
rm /tmp/rec22km.wav > /dev/null 2>&1
-------------

HTH - Chuck



Visit me at http://www.valstar.net/~hallenbeck
The Moon is Waning Gibbous (98% of Full)



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

* Re: alsa and sox questions
     ` Kerry Hoath
@      ` Geoff Shang
  0 siblings, 0 replies; 22+ messages in thread
From: Geoff Shang @  UTC (permalink / raw)
  To: speakup

On Fri, 29 Mar 2002, Kerry Hoath wrote:

> My sox does not have agc, this is version 12.17.3.
> It has avg but that is for merging channels.

avg is what I meant.   In my version, 12.16, you can also use it to extract
either the left or right channels.  Here's the bit from the man page:

       avg [ -l | -r ]
                 Reduce  the  number of channels by averaging the
                 samples, or duplicate channels to  increase  the
                 number  of channels.  Valid combinations are 1 -
                 2, 1 - 4, 2 - 4, 4 - 2, 4 - 1, 2 - 1. The -l  or
                 -r  option  is  not  really averaging but either
                 duplicates or leaves  just  the  left  or  right
                 channel,  depending  on  if  your  increasing or
                 decreasing the number of output channels.

It's odd that it has this functionality, given the existance of 'pick'.

Geoff.




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

* Re: alsa and sox questions
         ` jwantz
@          ` Geoff Shang
             ` jwantz
  0 siblings, 1 reply; 22+ messages in thread
From: Geoff Shang @  UTC (permalink / raw)
  To: speakup

On Fri, 29 Mar 2002 jwantz@hpcc2.hpcc.noaa.gov wrote:

> Interesting.  I reverted back to 5.12 because the driver for my card
> (AWE64) is broken in the beta versions.

hmmm.  I'm using an AWE64 gold with 0.9beta10 and it works just fine.  I
did have a few minor hassles compiling it if I recall, but it does work
just fine.

Geoff.




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

* Re: alsa and sox questions
           ` Charles Hallenbeck
@            ` Gregory Nowak
  0 siblings, 0 replies; 22+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

Thanks Chuck. I'll try this out.
Greg


On Fri, Mar 29, 2002 at 04:55:15PM -0500, Charles Hallenbeck wrote:
> Greg -
> Your example showed that you did not use any parameters with the
> arecord command at all. No wonder it did not work!
> 
> I will include below a script which I use to record wav files but
> first I will talk about it.
> 
> The script contains some statements that let you use "ctrl-c" to
> interrupt a running program without interrupting the script
> itself. The reason is that I want to run arecord for an
> indefinite amount of time and interrupt it when the work is done,
> but I want the script to continue.
> When the recording is complete, I want to use sox to copy it to
> my home directory from the /tmp directory where it was created,
> so that sox can fix the length parameter in the RIFF header as a
> by-product.
> The script is called "rec22km" which means 22k sampling rate and
> mono format. I have other scripts for 22k stereo and other
> speeds, Mono and stereo. All the scripts produce 16 bit signed
> samples.
> The script can be run just by typing the script name, in which
> case the resulting file in your home directory will be
> "rec22km.wav", or you can include a name such as "myvoice" on the
> command line: "rec22km myvoice" and the resulting file in your
> home directory will be called "myvoice.wav".
> Once the copying is complete, the file is played just for kicks,
> and to verify that it worked. You can also interrupt the play
> command with ctrl-c and the script survives so that it can remove
> the /tmp file before exiting.
> 
> The parameters on the arecord command are what you have failed to
> include. I use "-d 7200" to allow a ridiculously long duration.
> This parameter was optional in earlier versions, but somewhere
> along the way the default duration became "0 seconds" so you have
> to give it a positive value.
> I use "-q" to throw away the reporting messages.
> I use "-r 22050" to set the sampling rate.
> I use "-f S16_LE" to specify the format of the output file:
> S16_LE means "signed 16 bit little endian". This parameter has
> changed regularly with each upgrade and is a pain in the ass to
> keep track of when you upgrade.
> I use the "-c1" parameter to specify one channel (i.e., monaural)
> and a space between the 'c' and the '1' is permitted but not
> required.
> Finally comes the file name.
> The trailing ')' on the arecord line of the script below belongs
> to the subshell interruption control from the previous line.
> 
> Sorry this has been so complicated, but once you get it going it
> works like a charm. Of course you must be sure you have enable
> 'capture' on the input source you want to record (you cannot just
> set your speaker level, since that is not the signal that gets
> recorded). For example you would want to mute your mike channel
> or turn the speaker volume off, but enable capture on the mike
> channel and adjust the capture volume appropriately. I have to
> use different capture volume settings for mike, CD, and Line, but
> once they are set, arecord works like a charm for me.
> 
> Here is the script:
> -------------
> #!/bin/bash
> trap "" SIGINT # ignore ^C
> (trap - SIGINT # except in this subshell
> arecord -d 7200 -q -r 22050 -f S16_LE -c1 /tmp/rec22km.wav )
> echo wait...
> if [ "$1" = "" ]; then
> sox /tmp/rec22km.wav rec22km.wav >/dev/null 2>&1
> echo rec22km.wav
> (trap - SIGINT # except in this subshell
> play rec22km.wav )
> else
> sox /tmp/rec22km.wav $1.wav >/dev/null 2>&1
> echo $1.wav
> (trap - SIGINT # except in this subshell
> play $1.wav )
> fi
> rm /tmp/rec22km.wav > /dev/null 2>&1
> -------------
> 
> HTH - Chuck
> 
> 
> 
> Visit me at http://www.valstar.net/~hallenbeck
> The Moon is Waning Gibbous (98% of Full)
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup


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

* Re: alsa and sox questions
     ` Gregory Nowak
       ` Igor Gueths
@      ` Kerry Hoath
         ` Geoff Shang
         ` Ari Moisio
  1 sibling, 2 replies; 22+ messages in thread
From: Kerry Hoath @  UTC (permalink / raw)
  To: speakup

You set it high enough so your sample is loud but does not clip.
You can use the dac to adc loopback feature of the ac97 codec which an sblive
has, but I don't know how to do that with newer alsa or oss.
I just do it by trial and error.

Regards, Kerry.
On Fri, Mar 29, 2002 at 02:59:17PM -0600, Gregory Nowak wrote:
> Thanks. One more question that came to me is what's the best way to set the volume on the card line in jack, and on the tape player, so that the sound quality is just right. The reason I'm asking this is because my choice seems to be only to wire the line in of the card to the headphone jack of the tape player.
> Greg
> 
> 
> On Fri, Mar 29, 2002 at 07:53:14PM +0800, Kerry Hoath wrote:
> > Yes you can do channel fiddling I do this when I am copying 4-track tapes.
> > You use the pick effect to split out a channel like this:
> > sox stereo.wav -c1 mono_left.wav pick -l

-- 
Kerry Hoath:  kerry@gotss.net kerry@gotss.eu.org or  kerry@gotss.spice.net.au
ICQ: 8226547 msn: kerry@gotss.net Yahoo: kerryhoath@yahoo.com.au


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

* Re: alsa and sox questions
           ` Geoff Shang
@            ` jwantz
  0 siblings, 0 replies; 22+ messages in thread
From: jwantz @  UTC (permalink / raw)
  To: speakup

Hi Geof,
Well everything worked fine except Speak Freely.  I had a lot of white 
noise on my transmissions and people's voices would suddenly sound like 
a 1 7/8 IPS recording played at 15/16 IPS.  Jim suggested that I drop 
back to the latest stable release and now everything works like it used 
to.

     Jim Wantz
On Sat, 30 Mar 2002, Geoff Shang wrote:

> On Fri, 29 Mar 2002 jwantz@hpcc2.hpcc.noaa.gov wrote:
> 
> > Interesting.  I reverted back to 5.12 because the driver for my card
> > (AWE64) is broken in the beta versions.
> 
> hmmm.  I'm using an AWE64 gold with 0.9beta10 and it works just fine.  I
> did have a few minor hassles compiling it if I recall, but it does work
> just fine.
> 
> Geoff.
> 
> 
> 
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
> 



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

* Re: alsa and sox questions
       ` Kerry Hoath
@        ` Geoff Shang
         ` Ari Moisio
  1 sibling, 0 replies; 22+ messages in thread
From: Geoff Shang @  UTC (permalink / raw)
  To: speakup

Hi:

Unless your card is noisy,  getting the exact volume is not that big of a
deal, as you can normalise it later.  To do this, do the following:

1.  Record your material at a safe level (i.e. at one where the levels do
not clip).

2.  Assuming you called it recording.wav, do the following:

sox recording.wav -e stat

This will print a number of statistics about the file.  The final one will
look something like this:

Volume adjustment: 1.000

If the number is above 1.0, it means that the file can be amplified without
it clipping.  The above example is for a file that is already as loud as it
can go.

3.  Now do the following:

sox -v <volume adjustment> recording.wav normalised_recording.wav

Where <volume adjustment> is the value in the output as shown above.

This will make a copy of your recording that can be as loud as possible
without clipping (i.e. it is normalised).

Geoff.


-- 
Geoff Shang <gshang@uq.net.au>
ICQ number 43634701

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html




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

* Re: alsa and sox questions
       ` Kerry Hoath
         ` Geoff Shang
@        ` Ari Moisio
  1 sibling, 0 replies; 22+ messages in thread
From: Ari Moisio @  UTC (permalink / raw)
  To: Speakup mailing list

Hi!

  I use followinc c code to check record level. It will take two optinal
parameters: positive integer is time in seconds and negative interger is
warning level in decibels when program will send bell character to
terminal in addition to normal output.

  Output is rms level and peak leven.

-- 
Mr. Ari Moisio, Niittykatu 7, 41160 Tikkakoski, +358-40-5055239
ari.moisio@iki.fi http://www.iki.fi/arimo PGP-keyID: 0x3FAF0F05


// Record level 'meter'
// Results: rms / peak in db.
// Compile gcc -lm vumeter.c -o vumeter
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <math.h>

int signo = 0;

void handler(int sno)
{
signo = sno;
}

int main(int argc, char **argv)
{
int t_val, max, secs = 5, retval = 0, c_rms = 0, warn = -1, tmp;
long s_cnt = 0, s_sum = 0;
float level = 0.0, rms=0.0, max_level=99.9, s_rms=0.0;
FILE *dsp_fd;

signal(SIGINT, handler);

for (tmp = 1; tmp < argc; tmp++)
	{
	t_val = atoi(argv[tmp]);
	if (t_val > 0) secs = t_val;
	if (t_val < 0) warn = -t_val;
	}
// endfor

dsp_fd = fopen("/dev/dsp","r");
max = 0;
s_sum = 0;
for (; secs > 0 && signo == 0; secs -= 1)
	{
	max = 0;
	s_sum = 0;
	s_cnt = 0;
	for (s_cnt = 1; s_cnt <= 8000; s_cnt++)
		{
		t_val = fgetc(dsp_fd) - 0x80;
		if (t_val < 0) t_val = -t_val;
		if (t_val > 127) t_val = 127;
		if (t_val > max) max = t_val;
		s_sum += t_val * t_val;
		}
	// endfor
	if (signo ==0)
		{
		level = (log10(127.0 / max)) * 20;
		rms = (log10(127.0 / sqrt(s_sum / s_cnt)) * 20);
		if (level < warn) printf("\a");
		printf("%4.1f / %4.1f\n", -rms, -level);
		if (level < max_level) max_level = level;
		s_rms += rms;
		c_rms++;
		}
	// endif signo eq 0
	}
// endfor secs
fclose(dsp_fd);

printf("============\n%4.1f / %4.1f\n", -s_rms / c_rms, -max_level);
retval = floor(max_level);

return retval;
}




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

end of thread, other threads:[~ UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 alsa and sox questions Gregory Nowak
 ` Geoff Shang
   ` Gregory Nowak
     ` Charles Hallenbeck
       ` Gregory Nowak
         ` Charles Hallenbeck
           ` Gregory Nowak
   ` Kerry Hoath
     ` Geoff Shang
 ` Cheryl Homiak
 ` Charles Hallenbeck
   ` jwantz
     ` Charles Hallenbeck
       ` jwantz
         ` Geoff Shang
           ` jwantz
 ` Kerry Hoath
   ` Gregory Nowak
     ` Igor Gueths
     ` Kerry Hoath
       ` Geoff Shang
       ` Ari Moisio

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 read-only IMAP folder(s) and NNTP newsgroup(s).