Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > accessing mixer values

Reply
Thread Tools

accessing mixer values

 
 
ruud
Guest
Posts: n/a
 
      03-27-2008
hi group

I want to read the volume of the mixer device with a ruby script.
Can anybody tell me what the ruby equivalent is of what the MIXER_READ
macro does in C?

#define SOUND_MIXER_VOLUME 0
#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
#define MIXER_READ(dev) _SIOR('M', dev, int)

I've been googling with keywords like 'ioctl, MIXER_READ SOUND_MIXER',
but with little result. Hopefully someone can me push me in the right
direction...


thanks in advance,

Ruud
 
Reply With Quote
 
 
 
 
ts
Guest
Posts: n/a
 
      03-27-2008
ruud wrote:
> I want to read the volume of the mixer device with a ruby script.
> Can anybody tell me what the ruby equivalent is of what the MIXER_READ
> macro does in C?


I'm sure that you'll happy to know that, on linux, MIXER_READ(dev) do
this

(((2U) << (((0 +++14)) | ((('M')) << (0 +) | (((dev)) << 0) |
(((((sizeof(int) == sizeof(int[1]) && sizeof(int) < (1 << 14)) ?
sizeof(int) : __invalid_size_argument_for_IOC))) << ((0 ++))




> I've been googling with keywords like 'ioctl, MIXER_READ SOUND_MIXER',
> but with little result. Hopefully someone can me push me in the right
> direction...


perhaps best if you use Ruby::Inline to access it

http://rubyforge.org/projects/rubyinline/


Guy Decoux



 
Reply With Quote
 
 
 
 
Ron Fox
Guest
Posts: n/a
 
      03-28-2008
It encodes the ioctl request argument for a transfer of data from the
device to the program. See:
man ioctl

you may also need to look at the ioctl.h header.
_SIOR in at least the linux soundcard.h file just maps directly to _IOR

RF
ruud wrote:
> hi group
>
> I want to read the volume of the mixer device with a ruby script.
> Can anybody tell me what the ruby equivalent is of what the MIXER_READ
> macro does in C?
>
> #define SOUND_MIXER_VOLUME 0
> #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
> #define MIXER_READ(dev) _SIOR('M', dev, int)
>
> I've been googling with keywords like 'ioctl, MIXER_READ SOUND_MIXER',
> but with little result. Hopefully someone can me push me in the right
> direction...
>
>
> thanks in advance,
>
> Ruud

 
Reply With Quote
 
Ron Fox
Guest
Posts: n/a
 
      03-28-2008

http://www.4front-tech.com/pguide/sndcrd.html

May also help now that you know that

_SIOR is just _IOR.

search there for MIXER_READ...below it are the legal values for dev if
I'm getting this right.



ruud wrote:
> hi group
>
> I want to read the volume of the mixer device with a ruby script.
> Can anybody tell me what the ruby equivalent is of what the MIXER_READ
> macro does in C?
>
> #define SOUND_MIXER_VOLUME 0
> #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
> #define MIXER_READ(dev) _SIOR('M', dev, int)
>
> I've been googling with keywords like 'ioctl, MIXER_READ SOUND_MIXER',
> but with little result. Hopefully someone can me push me in the right
> direction...
>
>
> thanks in advance,
>
> Ruud

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixer.exe taking up CPU monros Computer Support 1 08-10-2005 03:45 PM
Re: Creative Mixer pcbutts1 Computer Support 0 07-06-2005 02:00 PM
Missing Audio Mixer/Volume Controls HJB Computer Support 3 06-25-2004 08:39 PM
Mixer gorcol Computer Support 3 06-08-2004 04:23 PM
Sound Card Mixer Needed Fudge Computer Support 4 02-22-2004 06:00 PM



Advertisments