pvanallen / delft-ai-toolkit

Tool for Prototyping AI Projects
30 stars 3 forks source link

virt Speech to Text does not work on MacBook Pro #17

Open pvanallen opened 4 years ago

pvanallen commented 4 years ago

When running the toolkit in Unity on a MacBook Pro 2017 or later, the Speech to Text fails with an error. It seems to work fine on an iMac as well as Windows machines.

[SpeechToText.OnListenMessage()][ERROR] Error: could not detect endianness after looking at the tail 0 non-zero byte string in a data stream of 22050 bytes. Is the bytestream really PCM data?

pvanallen commented 4 years ago

This is apparently caused by Unity not getting correct security rights to the Mic.

To give Unity the proper security rights, do the following based on this Unity Issue.

This process involves rebooting the computer into recovery mode so that you have the ability to make changes to the security settings via the Terminal.

1) Disable SIP: Go into recovery mode (hold CMD+R when you restart your Mac) Don’t be afraid, we are not doing anything crazy. 2) After that open Terminal (it should be accessible from one of the Menus at the Top) Type in csrutil disable and hit enter. Then reboot your Mac normally. 3) Open Terminal and type in: sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db and hit enter 4) For microphone access, type in at the sqlite prompt: INSERT INTO access VALUES(‘kTCCServiceMicrophone’,‘com.unity3d.unityhub’,0,1,1,NULL,NULL,NULL,‘UNUSED’,NULL,0,1541440109); and hit enter 5) For camera, which is not needed for this fix, type in: INSERT INTO access VALUES(‘kTCCServiceCamera’,‘com.unity3d.unityhub’,0,1,1,NULL,NULL,NULL,‘UNUSED’,NULL,0,1541440109); and hit enter 6) check in your SystemPreferences/Security&Privacy and Unity hub should now show up in both mic (and cam) 7) reboot in recovery mode again (CMD+R), open terminal again, type in: “csrutil enable” and hit enter, to enable SIP again 8) reboot normally and enjoy!