Skip to content

pyliaorachel/granny

Repository files navigation

Granny

Image

HappyGranny SadNeutralGranny SurprisedAngryGranny

Granny is an app aimed at helping people understand their emotions without having to overcome difficulties such as seeking out outside assistance. One may easily open the app and talk to Granny, and Granny will respond, reflective of your emotions. Voice recording, text transcription, emotion data, and data analysis are stored and may be perused at one's leisure, (not yet implemented) making Granny an ideal journaling app for the emotionally vulnerable.

Further details can be found here.

Platform

Currently only Android is supported.

Usage

  1. Make sure your devices are set up as outlined here and AndroidStudio installed.
  2. Clone the project.
  3. Register an Azure Cognitive Services Account on Emotion API and retrieve a key.
  4. Under the root directory, create a file config.js and add:
module.exports = {
  OcpApimSubscriptionKey: '[your-key]',
};
  1. Go to Granny's project directory, then run npm install.
  2. Go to ./node_modules/react-native-audio/android/...../AudioRecorderManager.java and add body.putInt("maxAmplitude", recorder.getMaxAmplitude()); here:
...
private void startTimer(){
  ...
    @Override
    public void run() {
      WritableMap body = Arguments.createMap();
      body.putInt("currentTime", recorderSecondsElapsed);
      body.putInt("maxAmplitude", recorder.getMaxAmplitude());        // <-- ADD HERE
      sendEvent("recordingProgress", body);
      recorderSecondsElapsed++;
    }
  ...
}
...
  1. Import Granny into AndroidStudio, and press Run.
  2. Return to the root project directory, and run react-native run-android.

Technical Components

The app is built on React Native and embedded with Microsoft Azure Emotion API to understand people's emotion in near real-time. We use react-native camera to capture user's face and call the emotion API every several seconds (thanks to react-native-fetch-blob).

To detect whether the user has done talking, we modified react-native-audio to return maxAmplitude during audio recording process and compare it with the background amplitude to decide whether or not to continue to the next question. The background amplitude is collected during the opening - that's why you need to keep calm and wait for Granny.

Granny's voice is contributed by react-native-tts. Granny's actions are contributed by react-native-animatable.

The charts in the report is supported by react-native-pathjs-charts.

About

A React Native app for emotion tracking.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors