Skip to content

Conversation

@proppy
Copy link
Contributor

@proppy proppy commented May 11, 2017

  • fallback on default audio device if I2S is not available
  • load credentials from resource

Fixes #8
Closes #9

- fallback on default audio device if I2S is not available - load credentials from resource Change-Id: I7f56a4d2f38ec1454811ea0a50fb1b8dcd4b49f8
Copy link
Collaborator

@drigz drigz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really cool change! Is there an overview anywhere of the audio support on the different boards? It was really hard to figure it out when I looked before.

PS. I'm still getting used to GitHub reviews. If I make comments and approve, does it work the same way as in Critique? Consider this an LGTM anyway.

README.md Outdated
==============================================

This sample shows how to call the Google Assistant API from Android Things using the [AIY Projects Voice Kit][voice-kit].
This sample shows how to call the Google Assistant API from Android Thing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

README.md Outdated
This sample shows how to call the Google Assistant API from Android Thing.

It records a spoken request from the I2S microphones, send it to the Google Assistant API and plays back Assistant's spoken response on the speaker connected to the I2S DAC.
It records a spoken request from the connected microphones, send it to the Google Assistant API and plays back Assistant's spoken response on the connected speaker.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sends ... the Assistant's

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

try {
Log.d(TAG, "creating voice hat driver");
mVoiceHat = new VoiceHatDriver(
BoardDefaults.getI2SDeviceForVoiceHat(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: here you use I2S, but on line 244 you use I2s. Picking one would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android framework has to use CamelCase even for abbreviation. But we have relaxed style guidelines for our sample.

mLed.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW);
} catch (IOException e) {
Log.d(TAG, "error creating voice hat driver:", e);
Log.d(TAG, "error configuring peripherals:", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardize on a log level for your exceptions. ERROR is used below, I would recommend WARNING across the board.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch: this should be .e

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I tried to use .e for fatal error, .w for non fatal one, .i for regular demo message, .d for spammy demo message.

README.md Outdated
--------------

- Get the `client_secret_NNNN.json`
[OAuth client ID][oauth2-installed-app] JSON file for the application from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the instructions to generate this file are not inline, it would be preferred to link folks to the docs that describe creating new OAuth credentials.

Copy link
Contributor Author

@proppy proppy May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and refactor other link to refer to the doc.

app: update logs level Change-Id: I6638c9fbc6e844f67254fdc2dad79d06b1fc1b36
@proppy
Copy link
Contributor Author

proppy commented May 12, 2017

/cc @irataxy fyi

@proppy proppy merged commit 405d4d4 into androidthings:master May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants