serenadeai / serenade

Apache License 2.0
317 stars 57 forks source link

Custom Pronunciations causes app to stop working #23

Open jacobdgm opened 1 year ago

jacobdgm commented 1 year ago

System Information

Serenade Version: v2.0.2

OS and Version: macOS Monterey 12.6.2

Hardware: 2020 M1 Mac mini (i.e. I'm running Serenade using Rosetta)

Application: N/A (I happen to be using Serenade with VS Code, but this issue occurs even when VS Code is not running)

Issue Description

I'm working on an open-source Gregorian chant database, and Serenade keeps hearing "chance" whenever I say "chants". When I append serenade.global().pronounce("chance", "chants"); to custom.js and launch Serenade, the app doesn't respond to anything I say (i.e. "focus code" and similar commands have no effect, and Serenade doesn't give a numbered list of suggested commands to execute). With an empty custom.js (i.e. the default file, with a 24-line comment and nothing else), the app works just fine (other than mishearing "chants", of course)

How to Reproduce

(File should look something like this)
/* Serenade Custom Commands

In this file, you can define your own custom commands with the Serenade API.

For instance, here's a custom automation that opens your terminal and runs a command:

serenade.global().command("make", api => {
  api.focusApplication("terminal");
  api.typeText("make clean && make");
  api.pressKey("return");
});

And, here's a Python snippet for creating a test method:

serenade.language("python").snippet(
  "test method <%identifier%>",
  "def test_<%identifier%>(self):<%newline%><%indent%>pass",
  { "identifier": ["underscores"] }
  "method"
);

For more information, check out the Serenade API documentation: https://serenade.ai/docs/api

*/
serenade.global().pronounce("chance", "chants");