-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a36df50
commit 4e92e5e
Showing
1 changed file
with
55 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,87 @@ | ||
# perse-sdk-js | ||
# yoo-recorder | ||
|
||
## How to run the project | ||
`` | ||
npm install | ||
npm install @cyberlabsai/yoo-recorder | ||
npm run serve | ||
`` | ||
|
||
## How to build and use it on another project | ||
## How to build locally and use it on another project | ||
After installing the project: | ||
|
||
1- At the root of Perse sdk directory, run: `npm link` | ||
1- At the root of Yoo Recorder directory, run: `npm link` | ||
|
||
2- In the project that you want to use Perse sdk, run: `npm link @cyberlabsai/perse-sdk-js` | ||
2- In the project that you want to use Yoo Recorder, run: `npm link @cyberlabsai/yoo-recorder` | ||
|
||
3- Then, run `npm run watch` on Perse directory | ||
3- Then, run `npm run watch` on Yoo Recorder directory | ||
|
||
## Authenticate | ||
## How to use it | ||
|
||
Signature: `Perse.face.authenticate(personFirstImage, personSecondImage)` | ||
``` | ||
import YooRecorder from '@cyberlabs/yoo-recorder' | ||
| Parameter | Description | Type | | ||
| -------------- |:---------------:| ----:| | ||
| personFirstImage | An image file | File or Blob | | ||
| personSecondImage | An image file | File or Blob | | ||
const recorder = YooRecorder() | ||
``` | ||
|
||
Returns: | ||
<br> | ||
It's important to allow microphone, to audio capture be possible. | ||
|
||
| Property | Description | Type | | ||
| ------------- |:-----------------------------------:| -------:| | ||
| status | Represents if authenticated succeed | boolean | | ||
| code | Success or failure code | string | | ||
| message | Feedback message | string | | ||
### Methods | ||
|
||
## start | ||
|
||
## Compare | ||
- It starts recording audio. | ||
|
||
Signature: `Perse.face.compare(personFirstImage, personSecondImage)` | ||
``` | ||
recorder.start() | ||
| Parameter | Description | Type | | ||
| -------------- |:---------------:| ----:| | ||
| personFirstImage | An image file | File or Blob | | ||
| personSecondImage | An image file | File or Blob | | ||
``` | ||
|
||
Returns: | ||
<br> | ||
|
||
| Property | Description | Type | | ||
| ------------- |:--------------------------------------------------------------:| ----------------:| | ||
| status | Represents if request succeed | boolean | | ||
| similarity | A number that represents the similarity gradation | number (0-100) | | ||
| code | Success or failure code | string | | ||
| image_tokens | An Array with array unique identifier generated from Perse API | `Array<string>` | | ||
| time_taken | Time taken to fulfill request | number | | ||
| message | Feedback message | string | | ||
## pause | ||
|
||
## Detect | ||
- Pauses current audio record. | ||
|
||
Signature: `Perse.face.detect(personImage)` | ||
``` | ||
recorder.pause() | ||
| Parameter | Description | Type | | ||
| -------------- |:---------------:| ----:| | ||
| personImage | An image file | File or Blob | | ||
``` | ||
|
||
Returns: | ||
<br> | ||
| Property | Description | Type | | ||
| ------------- |:--------------------------------------------: | -------:| | ||
| status | Represents if authenticated succeed | boolean | | ||
| code | Success or failure code | string | | ||
| message | Feedback message | string | | ||
| faces | Faces detected by Parse. see more | array | | ||
| image_metrics | An object with image quality data. see more | object | | ||
| image_token | A unique image identifier | string | | ||
| time_taken | Time taken to fulfill request | number | | ||
| total_faces | Total faces that are on image | number | | ||
## stop | ||
|
||
## Validate | ||
- It stops recording and clear it. | ||
|
||
Signature: `Perse.face.validate(personImage)` | ||
``` | ||
recorder.stop() | ||
| Parameter | Description | Type | | ||
| -------------- |:---------------:| ----:| | ||
| personImage | An image file | File or Blob | | ||
``` | ||
|
||
Returns: | ||
## clear | ||
|
||
- It clears recorded data. | ||
|
||
``` | ||
recorder.clear() | ||
``` | ||
|
||
## getMedia | ||
|
||
- Returns captured media. | ||
``` | ||
const media = recorder.getMedia() | ||
sendAudio(media.audioBlob) | ||
``` | ||
<br> | ||
Returns: | ||
|
||
| Property | Description | Type | | ||
| ------------- |:----------------------------------------------:| -------:| | ||
| audio | Audio file type | wmv | | ||
| audioBlob | Audio blob | binary | | ||
| audioUrl | Audio URL | string | | ||
| file | Audio file object | File | | ||
| play | Function to play recorded audio | Function| | ||
|
||
| Property | Description | Type | | ||
| ------------- |:--------------------------------------------: | -------:| | ||
| status | Represents if authenticated succeed | boolean | | ||
| code | Success or failure code | string | | ||
| message | Feedback message | array | |