Skip to content

Commit

Permalink
Fix IPA pronunciation
Browse files Browse the repository at this point in the history
https://www.ipaaudio.click/audio, which we were using
to convert the IPA notation to voice, is gone.

So, now, use http://ipa-reader.xyz instead. Looks like
someone or the other keeps building this using Amazon Polly
and maybe we can keep switching as and when these projects
die 🤷🏻‍♂️

Also, as Apple's on-device text-to-speech is quite good,
it worth considering dropping the IPA support altogether
and just use `say` with the word itself.
  • Loading branch information
mr-pennyworth committed Jun 18, 2024
1 parent b76de25 commit 5035786
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ Subsequent searches should be snappy
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>0.2.10</string>
<string>0.2.11</string>
<key>webaddress</key>
<string>https://github.com/mr-pennyworth/alfred-better-dictionaries</string>
</dict>
Expand Down
12 changes: 7 additions & 5 deletions sayipa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
ipa=$1
mp3_file="/tmp/ipa.mp3"

curl "https://www.ipaaudio.click/audio" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
--data "{\"ipa\": \"$ipa\"}" \
-o "$mp3_file"
curl 'https://iawll6of90.execute-api.us-east-1.amazonaws.com/production' \
-X POST \
--data-raw "{\"text\":\"$ipa\", \"voice\":\"Salli\"}" \
-o /tmp/b64ipa

python3 -c "print($(cat /tmp/b64ipa))" | \
base64 --decode --input - -o "$mp3_file"

afplay "$mp3_file"

0 comments on commit 5035786

Please sign in to comment.