tkem / openlap

Slot Car Race Management App for Carrera(R) Digital 124/132
Apache License 2.0
32 stars 24 forks source link

No audio output with PWA, Raspberry Desktop and Chromium #124

Closed Sand-Solutions closed 1 year ago

Sand-Solutions commented 3 years ago

Thank you very much for the great project OpenLAP. When I first discovered the project, I immediately thought: this is ideal for a Raspberry as a racing computer and so I started experimenting with it. In short: everything works great as PWA with Chromium, version 87.0.4280.141 (Developer Build) built on Debian 10.7, running on Debian 10.7 (32-bit) (Raspberry Desktop https://www.raspberrypi.org/software/raspberry-pi-desktop/)... ...except for the audio output.

The log file in OpenLAP returns the following error message: 22:24:14.094: Speech error { "isTrusted": true } if you hit the speaker symbol in the driver menue for example.

Hardware or driver errors can be ruled out.

Unfortunately, I have no experience with PWAs or MobileApps, but if OpenLAP would run on a Raspberry, it would be easy to get a powerful plug'n'play racing computer with HDMI, Bluetooth, WLAN & LAN for less than 50 EUR.

Sand-Solutions commented 3 years ago

SpeechSynthesisErrorEvent {isTrusted: true, error: "synthesis-failed", utterance: SpeechSynthesisUtterance, charIndex: 0, charLength: 0, …}
bubbles: false
cancelBubble: false
cancelable: false
charIndex: 0
charLength: 0
composed: false
currentTarget: SpeechSynthesisUtterance {text: "Peter", lang: "en-US", voice: null, volume: -1, rate: 1, …}
defaultPrevented: false
elapsedTime: 18.020000457763672
error: "synthesis-failed"
eventPhase: 0
isTrusted: true
name: ""
path: []
returnValue: true
srcElement: SpeechSynthesisUtterance {text: "Peter", lang: "en-US", voice: null, volume: -1, rate: 1, …}
target: SpeechSynthesisUtterance {text: "Peter", lang: "en-US", voice: null, volume: -1, rate: 1, …}
timeStamp: 1310178.3950000007
type: "error"
utterance: SpeechSynthesisUtterance {text: "Peter", lang: "en-US", voice: null, volume: -1, rate: 1, …}
__proto__: SpeechSynthesisErrorEvent```
tkem commented 3 years ago

@Sand-Solutions: Last time I tested with Chromium (on Intel platform), it was lacking support for text-to-speech output. This only seems to be supported with Google Chrome, but I don't know if that's available for the Pi.

Sand-Solutions commented 3 years ago

Thank you for pointing this out. It is correct, Chromium does not have the Google TTS service implemented. I got speech output to work by running

sudo apt-get install espeak sudo apt-get install speech-dispatcher

and start Chromium with parameter /usr/bin/chromium --enable-speech-dispatcher

But of course the quality is very bad and not really fun. I'm still experimenting with the Google TTS API at the moment, I already have an OAuth 2.0 key, but Chromiun needs third party plugins to connect both worlds.

Maybe it is possible to extend OpenLAP in a way that you might have the choice between different TTS providers (e.g. https://aws.amazon.com/de/polly/ for example)...

I will also still try to install Chrome itself on the Raspberry, let's see what the resource requirements will say.

tkem commented 3 years ago

@Sand-Solutions: Nice job making this work at all! Alternative TTS providers might be an option, but I don't have any experience with those, and I don't feel the urge to explore this myself ;-) My main target still is the Cordova/Ionic app for Android, and the PWA was more like a proof of concept. However, please let me know how things work out running Chrome on the Pi!