Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Changing volume in Linux with Perl?

by PipTigger (Hermit)
on Jan 16, 2001 at 16:15 UTC ( #52222=note: print w/replies, xml ) Need Help??

in reply to Changing volume in Linux with Perl?

I've tried hard to get ioctl && all the other .ph files to werk. I had to run h2ph on like 7 different .h files to fulfill all the embedded require's but I've tried tons of stuff for the past hour to tweak my new /usr/local/lib/site_perl/i386-linux/linux/ file so that it'd let my little script run to no avail. My little test is:
#!/usr/bin/perl -w require ''; require 'linux/'; my $data = 0; open MIXR, "</dev/mixer" || die "Can't open mixer!\n"; ioctl(MIXR, &MIXER_READ(0), $data) || die "Can't ioctl!\n"; close MIXR; print "data: $data\n";
This results in:

Use of uninitialized value at (eval 621) line 1.
Can't ioctl!

&& the eval ending on that line looks like another normal one:
eval 'sub SEQ_PITCHBEND { local($dev, $voice, $value) = @_; eval q( &SEQ_V2_X_CONTROL($dev, $voice, &CTRL_PITCH_BENDER, $ +value) ); }' unless defined(&SEQ_PITCHBEND);
If you can possibly point me in a better direction, I'd really appreciate it. I've been pounding my head against this for a long time && can't seem to go anywhere with this. I'm feeling really surprised at how difficult this seems to be in Perl! Maybe it's appropriate since it's one of the "hard/possible" things but it seemed like it should be "easy/easy". Anyways, I'm probably just gonna cave in && use C if I can't get Perl to do it within the next day or so. I really wanted to be competent enough to get this to werk on my own but I'm left to conclude that I'm really not experienced enough with Perl || Linux to do this alone yet. Thanks for any help or encouragement you can offer. I'm feeling kinda down (I thinq the caffeine is wearing off). TTFN.

p.s. Mr., would you please help my pony?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52222]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-09-17 21:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found