Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to "Built-in Output" before muting. #9

Open
hinderaker opened this issue Jun 4, 2016 · 3 comments
Open

Change to "Built-in Output" before muting. #9

hinderaker opened this issue Jun 4, 2016 · 3 comments

Comments

@hinderaker
Copy link

Hi. I have a feature request. Not really an issue with nobootsound as it is with my setup. I often use Apple EarPods or my “PlayStation Gold Wireless” at night (the most crucial time that the startup chime is muted). Problem is that nobootsound is working perfectly when setup is set to “Built-in Output”, but not when it is set to my other headset. Could nobootsound be tweaked to change to “Built-in Output” before muting in a future release?

@matteoacrossi
Copy link
Owner

For headphones it is a problem, because OS X keeps two distinct volume levels for headphones and internal speakers, but I can't access the internal speaker volume via Applescript when the headphones are plugged in.

For the wireless headset there might be hope if it is listed in system preferences as a separate audio device.

@matteoacrossi
Copy link
Owner

Just as a note to myself (or anyone interested in the bug), this Apple script allows to change to Internal Speakers as audio output device

set internal_speakers_string to "Internal Speakers"

tell application "System Preferences"
    reveal anchor "output" of pane id "com.apple.preference.sound"
    activate
    tell application "System Events"
        tell process "System Preferences"
            tell window "Sound"
                tell tab group 0
                    tell scroll area 1
                        tell table 1
                            set curr_sound_output to (value of text field 1 of (first UI element whose selected is true))

                            select (row 1 whose value of text field 1 is internal_speakers_string)
                                                        #here we should save the state of the device and mute it, or restore its previous state
                        end tell
                    end tell
                end tell
            end tell
        end tell
    end tell

    quit
end tell

For this script to work Applescript must be allowed in the Accessibility tab in System Preferences

@hinderaker
Copy link
Author

It is indeed a separate audio device. It restoring to previous state would be preferable, but not necessary. The goal is to avoid the chime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants