Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Falcon - v1.0 -> Python and C #1

Merged
merged 27 commits into from
Nov 28, 2023
1 change: 1 addition & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:
- 'lib/raspberry-pi/**'
- 'lib/windows/**'
- 'resources/audio_samples/*.wav'
- 'resources/.test/**'
mrrostam marked this conversation as resolved.
Show resolved Hide resolved

defaults:
run:
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,26 @@ Falcon is an on-device speaker diarization engine. Falcon is:
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64)
- Raspberry Pi (4, 3) and NVIDIA Jetson Nano


## Table of Contents

- [Falcon](#falcon)
- [Table of Contents](#table-of-contents)
- [AccessKey](#accesskey)
- [Demos](#demos)
- [Python Demos](#python-demos)
- [C Demos](#c-demos)
- [SDKs](#sdks)
- [Python](#python)
- [C](#c)
- [Releases](#releases)
- [FAQ](#faq)
- [Table of Contents](#table-of-contents)
- [What is Speaker Diarization?](#what-is-speaker-diarization)
- [AccessKey](#accesskey)
- [Demos](#demos)
- [Python Demos](#python-demos)
- [C Demos](#c-demos)
- [SDKs](#sdks)
- [Python](#python)
- [C](#c)
- [Releases](#releases)
- [FAQ](#faq)

## What is Speaker Diarization?

Speaker diarization, a fundamental step in automatic speech recognition and audio processing, focuses on identifying and
separating distinct speakers within an audio recording. Its objective is to divide the audio into segments while
precisely identifying the speakers and their respective speaking intervals.

## AccessKey

Expand Down Expand Up @@ -105,9 +111,10 @@ print(falcon.process_file('${AUDIO_PATH}'))
```

Replace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://console.picovoice.ai/) and
`${AUDIO_PATH}` to path an audio file.
`${AUDIO_PATH}` to path an audio file.

Finally, when done be sure to explicitly release the resources:

```python
falcon.delete()
```
Expand Down Expand Up @@ -153,6 +160,7 @@ Replace `${ACCESS_KEY}` with yours obtained from Picovoice Console, `${MODEL_PAT
[default model file](./lib/common/falcon_params.pv) (or your custom one), and `${AUDIO_PATH}` to path an audio file.

Finally, when done be sure to release resources acquired:

```c
pv_falcon_delete(falcon);
```
Expand Down
6 changes: 4 additions & 2 deletions binding/python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Falcon Speaker Diarization Engine
# Falcon Binding for Python

## Falcon Speaker Diarization Engine

Made in Vancouver, Canada by [Picovoice](https://picovoice.ai)

Expand Down Expand Up @@ -28,7 +30,7 @@ Signup or Login to [Picovoice Console](https://console.picovoice.ai/) to get you

### Usage

Create an instance of the engine and diarize an audio file:
Create an instance of the engine and perform speaker diarization on an audio file:

```python
import pvfalcon
Expand Down
2 changes: 1 addition & 1 deletion binding/python/_falcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def _get_error_stack(self) -> Sequence[str]:
message_stack_depth = c_int()
status = self._get_error_stack_func(byref(message_stack_ref), byref(message_stack_depth))
if status is not self.PicovoiceStatuses.SUCCESS:
raise self._PICOVOICE_STATUS_TO_EXCEPTION[status](message="Unable to get Porcupine error state")
raise self._PICOVOICE_STATUS_TO_EXCEPTION[status](message="Unable to get Falcon error state")

message_stack = list()
for i in range(message_stack_depth.value):
Expand Down
4 changes: 2 additions & 2 deletions include/pv_falcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ PV_API pv_status_t pv_falcon_process_file(
pv_segment_t **segments);

/**
* Deletes segments allocated by `pv_falcon_process()`.
* Deletes segments allocated by `pv_falcon_process()` and `pv_falcon_process_file()`.
*
* Use this function to properly release memory allocated for segments returned by the
* `pv_falcon_process()` functions.
* `pv_falcon_process()` and `pv_falcon_process_file()` functions.
*
* @param segments Pointer to the array of segments to be deleted.
*/
Expand Down
Loading