Skip to content

Commit

Permalink
Added sound output dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
chigkim committed May 7, 2020
1 parent 76b5d74 commit 577859f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
8 changes: 4 additions & 4 deletions VOCR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9N598S2535;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -534,7 +534,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = "1.0.0-alpha";
MARKETING_VERSION = "1.0.0-beta";
PRODUCT_BUNDLE_IDENTIFIER = com.chikim.VOCR;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -549,7 +549,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 9N598S2535;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -561,7 +561,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = "1.0.0-alpha";
MARKETING_VERSION = "1.0.0-beta";
PRODUCT_BUNDLE_IDENTIFIER = com.chikim.VOCR;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
24 changes: 22 additions & 2 deletions VOCR/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Cocoa

import AudioKit

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
Expand All @@ -10,6 +10,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ notification: Notification) {
let menu = NSMenu()
menu.addItem(withTitle: "Sound Output...", action: #selector(AppDelegate.chooseOutput(_:)), keyEquivalent: "")
menu.addItem(withTitle: "About", action: #selector(AppDelegate.displayAboutWindow(_:)), keyEquivalent: "")
menu.addItem(withTitle: "Quit", action: #selector(AppDelegate.quit(_:)), keyEquivalent: "")

Expand All @@ -35,7 +36,26 @@ class AppDelegate: NSObject, NSApplicationDelegate {
aboutWindowController.showWindow(nil)
}
}


@objc func chooseOutput(_ sender: Any?) {
let alert = NSAlert()
alert.alertStyle = .informational
alert.messageText = "Sound Output"
alert.informativeText = "Choose an Output for positional audio feedback."
if let devices = AudioKit.outputDevices {
for device in devices {
alert.addButton(withTitle: device.name)
}
}
let modalResult = alert.runModal()
let n = modalResult.rawValue-1000
if AudioKit.engine.isRunning {
try! AudioKit.stop()
}
try! AudioKit.setOutputDevice(AudioKit.outputDevices![n])
try! AudioKit.start()
}

@objc func click(_ sender: Any?) {
print("Clicked")
}
Expand Down
20 changes: 9 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Welcome to VOCR
[![VOCR Demo on Youtube](https://img.youtube.com/vi/maBtR_6KDFs/0.jpg)](https://www.youtube.com/watch?v=maBtR_6KDFs)

**WARNING**: USE AT YOUR OWN RISK! This is in alpha cycle. Many things may not work and change frequently without notice.

If you're using earlier MacOS than Catalina 10.15, please use the older [VOCR with tesseract.](https://github.com/chigkim/VOCR/tree/tesseract)
# Welcome to VOCR
**WARNING**: USE AT YOUR OWN RISK!

VOCR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, expressed or implied, of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please see the [GNU General Public License](http://www.gnu.org/licenses/) for more details.

## ***HIGHLY EXPERIMENTAL***
This branch utilizes VisionKit on MacOS Catalina that take advantage of machine learning for OCR.

This is a standalone app, and it does not rely on Keyboard Maestro, Imagemagick, and Tesseract that the previous VOCR utilized.

If you're using earlier MacOS than Catalina 10.15, please use the older [VOCR with tesseract.](https://github.com/chigkim/VOCR/tree/tesseract)

## Download
Here is the direct link to download [VOCR v1.0.0-alpha.3.](https://github.com/chigkim/VOCR/releases/download/v1.0.0-alpha.3/VOCR.v1.0.0-alpha.3.zip)
Here is the direct link to download [VOCR v1.0.0-beta.1.](https://github.com/chigkim/VOCR/releases/download/v1.0.0-beta.1/VOCR.v1.0.0-beta.1.zip)

## Upgrade from Previous VOCR With Tesseract
You can simply remove VOCR group from Keyboard Maestro and follow the instruction for setup below.
Expand Down Expand Up @@ -53,7 +50,7 @@ If you want to verify if it works properly, search images on Google image using
If everything goes well, VOCR will report the top 5 image categories in confidence order. If VOCR categorizes the image as a document, it will apply OCR. You can review the OCR result the same way as the section above, but this does not work with mouse movement.

## Settings
Positional audio (command+shift+control+p): As mouse cursor moves you will hear hear audio feedback. Frequency changes responds to vertical move, and pan responds to horizontal move. This feature is useful to explore the interface and discover elements' locations.
Positional audio (command+shift+control+p): As mouse cursor moves you will hear hear audio feedback. Frequency changes responds to vertical move, and pan responds to horizontal move. This feature is useful to explore the interface and discover elements' locations. If you don't hear the audio feedback, choose sound output for VOCR from menu extra.

Disable/enable reset position (command+shift+control+r): When disabled, the cursor will not reset to the top left corner after every new scan. This feature is useful when you rescan the same window to find new change without losing previous cursor.

Expand All @@ -72,9 +69,10 @@ The following shortcuts only works after a scan.
* Go to beginning/end horizontally: command+control+left/right arrow
* Exit navigation: escape
* Save OCR result to file: command+shift+control+s


## Troubleshooting
* If you hear "nothing found" or just hear the word "the", most likely either you need to turn off VoiceOver screen curtain with vo+shift+f11, or fix accessibility and screen recording permission in security and privacy preference.
* If you do not hear anything after recognize image under VoiceOver cursor, most likely you need to give VOCR permissions to 1. send Apple Events, 2. control VoiceOver, and 3. access desktop folder. Usually relaunching VOCR and reissuing the command usually retrigger the alerts to reappear in the system dialogs.


Lastly, please enjoy and send me your feedback!

0 comments on commit 577859f

Please sign in to comment.