4

As the title says, is there a way to get the input level in mac?

enter image description here

I want to get the value indicating in the input level bar(System Preferences -> Sound -> Input) in the pic.

Is it possible?

There are solutions on how to set the input and output volume but I can't find any solution to get the input level value.

6
  • What for? It'll impact the method.
    – JMY1000
    Commented Sep 16, 2017 at 3:57
  • @JMY1000 I'm thinking to create a script/program to decrease or increase the output volume if the output volume is too high. And I'm thinking to measure the output sound through the microphone Commented Sep 16, 2017 at 4:22
  • Found this gist. Check third line. Also I've personally used this one. They both are for Alfred. Just saying because it might be simplest to just use them through it.
    – Joonas
    Commented Sep 16, 2017 at 9:04
  • @Joonas As I mentioned in the last sentence in my question, there are many tutorials about getting and setting output volume. But I need to get the value of the Input level of the microphone. Commented Sep 16, 2017 at 10:13
  • 2
    Check soundmeter. I've also written an answer to this question: Can I access internal microphone input level via Terminal?.
    – klanomath
    Commented Sep 19, 2017 at 8:34

1 Answer 1

2

Sorry, I got that you wanted the input volume, I just failed to word that comment a bit better. I was just looking at that code and thinking "it would push you to the right direction". Kinda like, if there is a piece of code that is like get window width... and I wanted the height instead, then the logical step is probably get window height.

I did come back to this before, but I thought someone answered this already...


Here are some examples of setting input volume.

You can find get volume settings documentation here.

Input Volume

-- Get input volume
input volume of (get volume settings)

-- Set input volume
set volume input volume 40

-- Increment input volume (+)
set volume input volume ((input volume of (get volume settings)) + 5)

Output Volume

-- Get output volume
output volume of (get volume settings)

-- Set output volume
set volume output volume 40

-- Increment output volume (+)
set volume output volume ((output volume of (get volume settings)) + 5)

You can test these in the /Applications/Utilities/Script Editor.app. If you stick this: return (get volume settings) at the very end, after you've set volume levels, the result panel will give you the current values at the bottom of the window. Of course you could have the Sound preferences window open as well.

1
  • Oh man. I should really read these things more carefully. I guess it is possible someone did answer and then deleted the answer once they realized what I'm realizing now. What you want is basically the audio levels of the current input and not the current input volume. I think that may go beyond applescript. Since my answer does answer the question in the title, I think I'll keep it in case someone else finds this. As for your question, I can't help you.
    – Joonas
    Commented Sep 19, 2017 at 7:33

Not the answer you're looking for? Browse other questions tagged .