Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ai.picovoice.porcupinedemoservice.PorcupineService Class Reference
Inheritance diagram for ai.picovoice.porcupinedemoservice.PorcupineService:
Inheritance graph
[legend]

Public Member Functions

IBinder onBind (Intent intent)
 
void onDestroy ()
 
int onStartCommand (Intent intent, int flags, int startId)
 

Private Member Functions

void createNotificationChannel ()
 
Notification getNotification (String title, String message)
 
void onPorcupineInitError (String message)
 

Private Attributes

int numUtterances
 
PorcupineManager porcupineManager
 
final PorcupineManagerCallback porcupineManagerCallback
 

Static Private Attributes

static final String ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"
 
static final String CHANNEL_ID = "PorcupineServiceChannel"
 

Detailed Description

Definition at line 39 of file PorcupineService.java.

Member Function Documentation

◆ createNotificationChannel()

void ai.picovoice.porcupinedemoservice.PorcupineService.createNotificationChannel ( )
inlineprivate

Definition at line 58 of file PorcupineService.java.

◆ getNotification()

Notification ai.picovoice.porcupinedemoservice.PorcupineService.getNotification ( String  title,
String  message 
)
inlineprivate

Definition at line 115 of file PorcupineService.java.

◆ onBind()

IBinder ai.picovoice.porcupinedemoservice.PorcupineService.onBind ( Intent  intent)
inline

Definition at line 132 of file PorcupineService.java.

◆ onDestroy()

void ai.picovoice.porcupinedemoservice.PorcupineService.onDestroy ( )
inline

Definition at line 137 of file PorcupineService.java.

◆ onPorcupineInitError()

void ai.picovoice.porcupinedemoservice.PorcupineService.onPorcupineInitError ( String  message)
inlineprivate

Definition at line 109 of file PorcupineService.java.

◆ onStartCommand()

int ai.picovoice.porcupinedemoservice.PorcupineService.onStartCommand ( Intent  intent,
int  flags,
int  startId 
)
inline

Definition at line 71 of file PorcupineService.java.

Member Data Documentation

◆ ACCESS_KEY

final String ai.picovoice.porcupinedemoservice.PorcupineService.ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"
staticprivate

Definition at line 41 of file PorcupineService.java.

◆ CHANNEL_ID

final String ai.picovoice.porcupinedemoservice.PorcupineService.CHANNEL_ID = "PorcupineServiceChannel"
staticprivate

Definition at line 40 of file PorcupineService.java.

◆ numUtterances

int ai.picovoice.porcupinedemoservice.PorcupineService.numUtterances
private

Definition at line 44 of file PorcupineService.java.

◆ porcupineManager

PorcupineManager ai.picovoice.porcupinedemoservice.PorcupineService.porcupineManager
private

Definition at line 43 of file PorcupineService.java.

◆ porcupineManagerCallback

final PorcupineManagerCallback ai.picovoice.porcupinedemoservice.PorcupineService.porcupineManagerCallback
private
Initial value:
= (keywordIndex) -> {
final String contentText = numUtterances == 1 ? " time!" : " times!";
Notification n = getNotification(
"Wake word",
"Detected " + numUtterances + contentText);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
assert notificationManager != null;
notificationManager.notify(1234, n);
}

Definition at line 45 of file PorcupineService.java.


The documentation for this class was generated from the following file:
ai.picovoice.porcupinedemoservice.PorcupineService.getNotification
Notification getNotification(String title, String message)
Definition: PorcupineService.java:115
ai.picovoice.porcupinedemoservice.PorcupineService.numUtterances
int numUtterances
Definition: PorcupineService.java:44


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:20