Creating an 'earcon'

Hi!

I want to use an ‘earcon’, a sound that will trigger when the listening has started or ended. Does this mean I would have to put my code to play something in the Spokestack.Activate and Spokestack.Deactivate functions? And how would it work with SpokestackTray?

I’m grateful for any help

Hi Lirry,

An earcon is a great idea! Your intuition of where to wire it up is correct: activate and deactivate would let you trigger your earcon when listening starts and ends, respectively. As far as how an earcon would work with SpokestackTray, you can listen for the ACTIVATE/DEACTIVATE events (https://github.com/spokestack/react-native-spokestack-tray#spokestacklistenertype-enum). Alternatively, you could tie the earcon to the tray opening and closing with onOpen and onClose.

Finally, you might be aware Tray uses the platform ASR by default (unless you specify otherwise), which on Android means that the Android ASR will play the Google earcon unless the Android device user has disabled it in their settings.