Request: a command to change sound volume

paolone · 9062

paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
on: November 26, 2018, 07:58:58 AM
This is a help request to current Amiga developers. Unluckily I do not have the skill to do this by myself, but I guess many of you are. I'd need a simple utility in C to change the sound volume with AHI. A quick implementation of it would just change the 'main' volume, from 0 to 100%, for all the available music and audio units. Would anyone volounteer? Requisites: being open source and straight-to-compile on any Amiganoid system and platform.

My intermediate goal is just having the cance to open a shell window and give a command like

ahivolume 0 --> to set the overall sound volume to null
ahivolume 100 --> to set the overall sound volume to max

and obviously any intermediate value in the range 0-100, independently from the physical device used for sound (it shall work with any audio driver / audio mode).

Is this feasible? Or are ther technical problems making it a complete mess? Thank you.



The final (longer term) goal will be, at least on Icaros Desktop, writing a simple GUI/frontend in lua with a slider, a mute and a setting button, but I should be able to do this by myself.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #1 on: November 26, 2018, 08:42:37 AM
I've just realized that it should also show the current volume values, if called without any parameter...


cavemann

  • Junior Member
  • **
    • Posts: 78
    • Karma: +86/-0
Reply #2 on: November 26, 2018, 04:10:12 PM
There is an Arexx program in Aminet called mmvolume that controls volume. But it doesn't seem to worik on AROS. But perhaps something similar might be helpful.
 
« Last Edit: November 26, 2018, 04:18:47 PM by cavemann »



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #3 on: November 26, 2018, 11:33:34 PM
There is an Arexx program in Aminet called mmvolume that controls volume. But it doesn't seem to worik on AROS. But perhaps something similar might be helpful.
AROS and Arexx do not sound good together... :-(
That's why I've been asking for a command in C. By the way, I was just thinking about you writing it. :-)


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #4 on: November 27, 2018, 06:36:57 AM
There is an Arexx program in Aminet called mmvolume that controls volume. But it doesn't seem to worik on AROS. But perhaps something similar might be helpful.
Tested it right now on Icaros Desktop and, as you told me, it does not work. I get this output from RX command:
RX Mute
5 *-* MASTERMUTE  +++ RC=30 +++
But no change to sound volume.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #5 on: November 27, 2018, 06:45:24 AM
...but maybe it has to do with the fact that:
Quote
The Mixer commodity has to be running for the controls to work, though it doesn't have to be visible.
and we don't have such a commodity on AROS i386, AFAIK.



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #6 on: November 27, 2018, 06:53:42 AM
Would this be portable to AROS?
http://aminet.net/package/util/cdity/Mixer

Supports emu10kx, fm801, sb128, cmi8738, cs4281, Aureon 5.1 sky, M-Audio Revolution 5.1, ess1938/solo-1 chips, and A1-XE onboard sound (VIA686B) if you have the AC'97 codec chip onboard. The project and SVN are hosted at OpenAmiga.org.http://openamiga.org/?function=viewproject&projectid=62
« Last Edit: November 27, 2018, 07:31:41 AM by paolone »



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #7 on: November 28, 2018, 02:27:28 AM
On Amigaworld.net I got an interesting link. Please have a look at this:
https://amigaworld.net/modules/newbb/viewtopic.php?topic_id=42983&start=0&post_id=819274&order=0&viewmode=flat&pid=819265&forum=2#819274
and obviously this
https://en.m.wikibooks.org/wiki/Aros/Developer/AHIDrivers
Section Other Examples -> master volume utility
I cannot compile this by myself, too much higher skill required than mine. :-(


nikos

  • Senior Member
  • ****
    • Posts: 374
    • Karma: +71/-3
    • aspireos
Reply #8 on: November 28, 2018, 05:26:09 AM
I understand what you are looking for. Would be a great thing to have for AROS.

It would be nice to see and have some stuff like online, offline, master volume controll etc. in title bar or something.


BSzili

  • Newbie
  • *
    • Posts: 44
    • Karma: +80/-0
    • My AROS, MorphOS and AmigaOS4 ports
Reply #9 on: November 28, 2018, 06:12:28 AM
The only way I see this would be doable on AROS is to change the volume in the prefs file. Fortunately the format is public, there's an example on how to read it (CheckAHIPrefs), and the Prefs program is open source too with the rest of AHI.
I'm not very familiar with IFFParse.library, but I can give it a shot this weekend if nobody else is interested.

This is just like television, only you can see much further.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #10 on: November 28, 2018, 07:03:29 AM
@Nikos

I understand what you are looking for. Would be a great thing to have for AROS.

It would be nice to see and have some stuff like online, offline, master volume controll etc. in title bar or something.
You have centered the point. Either in AmiStart or in BoingIconBar or in the title bar... A gadget which would allow changing the damn sound volume on the fly is something I've been missing for too long, on AROS.

@BSzili
You would be welcome!!!!!


nikos

  • Senior Member
  • ****
    • Posts: 374
    • Karma: +71/-3
    • aspireos
Reply #11 on: November 28, 2018, 07:38:02 AM
BSzili: That would be fantastic  :)

You know a program like MPlayer got volume controll that is working with AROS.
Could not that part be made part of AROS and make some kind of volume slider.
It should be part of Wanderer. Every OS has something like this.
In Wanderer prefs, options, make some box to select or unselect volume controll in Titlebar.
At least that is what I would like to see.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #12 on: November 28, 2018, 09:24:36 AM
BSzili: That would be fantastic  :)

You know a program like MPlayer got volume controll that is working with AROS.
Could not that part be made part of AROS and make some kind of volume slider.
It should be part of Wanderer. Every OS has something like this.
In Wanderer prefs, options, make some box to select or unselect volume controll in Titlebar.
At least that is what I would like to see.
Even without taking pieces from Mplayer, we have the AHI preference program which can control volume. Just taking only the part which control the volume for the four units, and let it change the volume for all 4 together with a single slider, would be enough. I've even proposed a C command to do exactly the same thing, I'd have worked on a LUA GUI if necessary with the slider and the mute button alone. You are right it should be part of wanderer, however I'd prefer a separed solution so it would be usable with Magellan, Scalos, etc too.


BSzili

  • Newbie
  • *
    • Posts: 44
    • Karma: +80/-0
    • My AROS, MorphOS and AmigaOS4 ports
Reply #13 on: November 28, 2018, 10:17:27 AM
The original request was about a cli command, which I'll try to make. If somebody else wants to create a GUI for it, they can.
« Last Edit: November 28, 2018, 10:24:02 AM by BSzili »

This is just like television, only you can see much further.


paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #14 on: November 28, 2018, 01:49:20 PM
The original request was about a cli command, which I'll try to make. If somebody else wants to create a GUI for it, they can.
Great!