Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from ismarslomic/5-broadcast-request-gets-send-…
Browse files Browse the repository at this point in the history
…but-not-sound-on-speakers

#5 broadcast request gets send but not sound on speakers
  • Loading branch information
ismarslomic authored Jun 7, 2022
2 parents 9ee6ba7 + 0baab6b commit 66c5d50
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 149 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:17.8.0-alpine3.15
FROM node:18.2.0-alpine3.15

LABEL maintainer="Ismar Slomic <[email protected]>"

Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ services:
- "8085:8085"
volumes:
- /home/pi/config:/usr/src/config

```
```bash
Expand Down Expand Up @@ -128,3 +127,34 @@ curl -X POST http://localhost:8085/broadcast \
-d '{"message":"Hello world!!"}' \
-H "Content-Type: application/json"
```
## Known issues
#### 1. Broadcast request gets send, but not played/broadcast to the speakers
I was able to get the container up & running, but when I send broadcast request via
Postman/CURL/Home Asisstant no message is played on my speakers and I get the following lines in
the logs (more details about this issue at [#5](https://github.com/ismarslomic/google-assistant-broadcast/issues/5)):
```(bash)
Sending message: Broadcast Hello world!
[OK] Conversation Response: empty
[OK] Conversation Completed
```
This issue is related to the language settings we set in the container, when using the
Google Assistant SDK (default is `en-GB`). It's hard to say exactly what the issue is, but for me
it helped to switch from `en-US` to `en-GB`. It might also be necessary to play with the language
settings in the Google Assistant app for the same Google account.

You can try changing the language settings by setting the environment variable `LANGUAGE` to one of the
[supported languages codes](https://developers.google.com/assistant/sdk/reference/rpc/languages).

Add `-e LANGUAGE=<language_code>` option if running with `docker run` command or `environment` if you
use `docker-compose`:

```yaml
version: '3.8'
services:
google-assistant-broadcast:
...
environment:
- LANGUAGE=<language_code>
```
2 changes: 1 addition & 1 deletion assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const config = {
savedTokensPath: process.env.TOKEN || "/usr/src/config/tokens.json"
},
conversation: {
lang: 'en-US', // defaults to en-US, but try other ones, it's fun!
lang: process.env.LANGUAGE || 'en-GB', // defaults to en-GB, but try other ones, it's fun!
showDebugInfo: true, // default is false, bug good for testing AoG things,
isNew: true,
},
Expand Down
Loading

0 comments on commit 66c5d50

Please sign in to comment.