Sponsored Content
Operating Systems OS X (Apple) Hearing Aid for OSX 10.12.x and greater. Post 303030697 by wisecracker on Thursday 14th of February 2019 09:48:32 AM
Old 02-14-2019
Hearing Aid for OSX 10.12.x and greater.

Hearing Aid...
Hi folks yet another bizarre piece of code that is Apple OSX 10.12.x to at least 10.14.1 specific.
It requires only a default OSX install, and the internal microphone along with an external headphone assembly.

Pre-amble, 14-02-2019:
For over 3 weeks now I have been suffering a serious head cold and for the last 10 days serious hearing loss due to it.
This is supposedly temporary but it can be permanent, I won't know until March 7th when I am to see the doctor again.

The loss of hearing is so serious that it is around 30dB down in both ears. Sooooo this working idea was the result.

As I am nearly always on the terminal I decided to create a hearing aid using my enclosed, bin style, headphones without a microphone.

It is a simple shell script that calls an AppleScript to start QuickTime Player in standby Audio Recording mode.

Initialisng for the first time:
  • 1) Copy the script onto your preferred location, I called it HA.sh.
  • 2) Plug in the headphones and set up the audio from System Preferences.
  • 3) Open up a terminal and cd /path/to/your/preferred/location for 'HA.sh'.
  • 4) Set its access to chmod 755 HA.sh.
  • 5) Start the script, something like ./HA.sh
  • 6) Due to Apple's security you will probably be prompted to allow the terminal to access the microphone, just accept it.
  • 7) The Audio Recording window will open and a dialog window will warn you to set the monitor volume to maximum.
  • 8) The terminal will be in standby mode and can be exited if necessary.
  • 9) Drop/minimise the Audio Recording window onto the 'DOCK' and leave, in standby mode.
  • 10) This is super sensitive and you can alter the output from either the main volume or independently with the Recorder's own output level control.
  • 11) Other inputs, like youtube still work and don't affect the Recorder at all.
  • 12) When no longer needed close down the Recorder and QT in the normal GUI manner.


As I don't have access to hearing aids yet and I am on the computer a lot the this is a godsend.
It does have a slight delay from real time but it took me seconds to get used to it.
Code:
#!/bin/sh
# HA.sh
# Simple hearing aid for a default OSX 10.12.x and above install.

echo ""
echo "Starting hearing aid..."
echo "" > /tmp/Untitled.m4a

osascript << AppleSampler
    tell application "QuickTime Player"
        activate
        set savePath to "Macintosh HD:tmp:Untitled.m4a"
        set recording to new audio recording
        set visible of front window to true
        delay 1
        display alert "Set the output level to maximum and use the master volume as the output level."
        delay 1
    end tell
AppleSampler

echo ""
echo "Close down the Terminal at any time; the recorder"
echo "and QT in the usual way when finished with..."
echo ""
exit

Enjoy hearing again...

Bazza.

Last edited by wisecracker; 02-14-2019 at 01:21 PM..
These 4 Users Gave Thanks to wisecracker For This Post:
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Is there any visual aid program like Task Manager for Solaris?

In my project we have 3 Solaris 10 servers which need to be monitored for various parameters shown under "prstat -a" command. A shell script runs every 15 mins and captures prstat output by writing it in a log file. I manually download the log file at the end of the day and build graphical charts... (5 Replies)
Discussion started by: gppande
5 Replies
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy