From a7da5d041015822655c2293c1213eefa9b63becb Mon Sep 17 00:00:00 2001 From: berndmoos Date: Thu, 18 Apr 2024 12:39:56 +0200 Subject: [PATCH] #421: Get rid of puncutation oddities --- .../PartiturEditorTimeviewPlayerControl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/org/exmaralda/partitureditor/partiture/PartiturEditorTimeviewPlayerControl.java b/src/org/exmaralda/partitureditor/partiture/PartiturEditorTimeviewPlayerControl.java index 8e765ed6..3c89c2ad 100644 --- a/src/org/exmaralda/partitureditor/partiture/PartiturEditorTimeviewPlayerControl.java +++ b/src/org/exmaralda/partitureditor/partiture/PartiturEditorTimeviewPlayerControl.java @@ -210,6 +210,7 @@ public void run() { } public void whisperSuccess(String result, int editRow, int editCol, double startTime, double endTime) throws IOException, JexmaraldaException{ + result = postProcessWhisperResult(result); if ((editRow>=0) && (editCol>=0)){ partitur.getModel().setTableDataItem(result, editRow, editCol); } else { @@ -245,6 +246,16 @@ public void whisperSuccess(String result, int editRow, int editCol, double start } whisperASRAction.setEnabled(true); } + + private String postProcessWhisperResult(String result) { + // ": "We're really good friends on top of everything." + if (result.startsWith("\": \"") && result.trim().endsWith("\"")){ + String better = result.substring(4); + better = better.substring(0, better.lastIndexOf("\"")); + return better; + } + return result; + }