{"id":21423905,"url":"https://github.com/picovoice/falcon","last_synced_at":"2025-03-31T09:03:45.945Z","repository":{"id":209728824,"uuid":"690740039","full_name":"Picovoice/falcon","owner":"Picovoice","description":"On-device speaker diarization powered by deep learning","archived":false,"fork":false,"pushed_at":"2025-03-17T21:21:30.000Z","size":21185,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-22T20:26:44.118Z","etag":null,"topics":["deep-learning","diarization","on-device","speaker-diarization","speaker-recognition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Picovoice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-12T19:24:10.000Z","updated_at":"2025-03-17T21:21:31.000Z","dependencies_parsed_at":"2023-11-28T22:23:14.809Z","dependency_job_id":"3de78870-5dad-4b42-a0d8-0b6ce3f2f918","html_url":"https://github.com/Picovoice/falcon","commit_stats":{"total_commits":33,"total_committers":6,"mean_commits":5.5,"dds":"0.48484848484848486","last_synced_commit":"012b11b7c77e91173aae17a00b2ea341f6d02c20"},"previous_names":["picovoice/falcon"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Ffalcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Ffalcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Ffalcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picovoice%2Ffalcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Picovoice","download_url":"https://codeload.github.com/Picovoice/falcon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443536,"owners_count":20778248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","diarization","on-device","speaker-diarization","speaker-recognition"],"created_at":"2024-11-22T21:18:51.928Z","updated_at":"2025-03-31T09:03:45.926Z","avatar_url":"https://github.com/Picovoice.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Falcon\n\n[![GitHub release](https://img.shields.io/github/v/tag/Picovoice/falcon.svg)](https://github.com/Picovoice/falcon/releases)\n[![GitHub](https://img.shields.io/github/license/Picovoice/falcon)](https://github.com/Picovoice/falcon/)\n\n[![Maven Central](https://img.shields.io/maven-central/v/ai.picovoice/falcon-android?label=maven-central%20%5Bandroid%5D)](https://repo1.maven.org/maven2/ai/picovoice/falcon-android/)\n[![CocoaPods](https://img.shields.io/cocoapods/v/Falcon-iOS)](https://cocoapods.org/pods/Falcon-iOS)\u003c!-- markdown-link-check-disable-line --\u003e\n[![npm](https://img.shields.io/npm/v/@picovoice/falcon-web?label=npm%20%5Bweb%5D)](https://www.npmjs.com/package/@picovoice/falcon-web)\n[![PyPI](https://img.shields.io/pypi/v/pvfalcon)](https://pypi.org/project/pvfalcon/)\n\nMade in Vancouver, Canada by [Picovoice](https://picovoice.ai)\n\n[![Twitter URL](https://img.shields.io/twitter/url?label=%40AiPicovoice\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2FAiPicovoice)](https://twitter.com/AiPicovoice)\u003c!-- markdown-link-check-disable-line --\u003e\n[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCAdi9sTCXLosG1XeqDwLx7w?label=YouTube\u0026style=social)](https://www.youtube.com/channel/UCAdi9sTCXLosG1XeqDwLx7w)\n\nFalcon is an on-device speaker diarization engine. Falcon is:\n\n- Private; All voice processing runs locally.\n- Cross-Platform:\n  - Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64)\n  - Raspberry Pi (3, 4, 5)\n  - Android and iOS\n  - Chrome, Safari, Firefox, and Edge\n\n## Table of Contents\n\n- [Falcon](#falcon)\n  - [Table of Contents](#table-of-contents)\n  - [What is Speaker Diarization?](#what-is-speaker-diarization)\n  - [AccessKey](#accesskey)\n  - [Demos](#demos)\n    - [Python Demo](#python-demo)\n    - [C Demo](#c-demo)\n    - [Web Demo](#web-demo)\n    - [iOS Demo](#ios-demo)\n    - [Android Demo](#android-demo)\n  - [SDKs](#sdks)\n    - [Python](#python)\n    - [C](#c)\n    - [Web](#web)\n    - [iOS](#ios)\n    - [Android](#android)\n  - [Releases](#releases)\n  - [FAQ](#faq)\n\n## What is Speaker Diarization?\n\nSpeaker diarization, a fundamental step in automatic speech recognition and audio processing, focuses on identifying and\nseparating distinct speakers within an audio recording. Its objective is to divide the audio into segments while\nprecisely identifying the speakers and their respective speaking intervals.\n\n## AccessKey\n\nAccessKey is your authentication and authorization token for deploying Picovoice SDKs, including Falcon. Anyone who is\nusing Picovoice needs to have a valid AccessKey. You must keep your AccessKey secret. You would need internet\nconnectivity to validate your AccessKey with Picovoice license servers even though the speaker recognition is running\n100% offline.\n\nAccessKey also verifies that your usage is within the limits of your account. Everyone who signs up for\n[Picovoice Console](https://console.picovoice.ai/) receives the `Free Tier` usage rights described\n[here](https://picovoice.ai/pricing/). If you wish to increase your limits, you can purchase a subscription plan.\n\n## Demos\n\n### Python Demo\n\nInstall the demo package:\n\n```console\npip3 install pvfalcondemo\n```\n\nRun the following in the terminal:\n\n```console\nfalcon_demo_file --access_key ${ACCESS_KEY} --audio_paths ${AUDIO_PATH}\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from Picovoice Console.\n\nFor more information about Python demos go to [demo/python](./demo/python).\n\n### C Demo\n\nBuild the demo:\n\n```console\ncmake -S demo/c/ -B demo/c/build \u0026\u0026 cmake --build demo/c/build\n```\n\nRun the demo:\n\n```console\n./demo/c/build/falcon_demo -a ${ACCESS_KEY} -l ${LIBRARY_PATH} -m ${MODEL_PATH} ${AUDIO_PATH}\n```\n\n### Web Demo\n\nFrom [demo/web](demo/web) run the following in the terminal:\n\n```console\nyarn\nyarn start\n```\n\n(or)\n\n```console\nnpm install\nnpm run start\n```\n\nOpen `http://localhost:5000` in your browser to try the demo.\n\n### iOS Demo\n\nTo run the demo, go to [demo/ios/FalconDemo](./demo/ios/FalconDemo) and run:\n\n```console\npod install\n```\n\nReplace `let accessKey = \"${YOUR_ACCESS_KEY_HERE}\"` in the file [ViewModel.swift](./demo/ios/FalconDemo/FalconDemo/ViewModel.swift) with your `AccessKey`.\n\nThen, using [Xcode](https://developer.apple.com/xcode/), open the generated `FalconDemo.xcworkspace` and run the application.\n\n### Android Demo\n\nUsing Android Studio, open [demo/android/FalconDemo](./demo/android/FalconDemo) as an Android project and then run the application.\n\nReplace `\"${YOUR_ACCESS_KEY_HERE}\"` in the file [MainActivity.java](./demo/android/FalconDemo/falcon-demo-app/src/main/java/ai/picovoice/falcondemo/MainActivity.java) with your `AccessKey`.\n\n## SDKs\n\n### Python\n\nInstall the Python SDK:\n\n```console\npip3 install pvfalcon\n```\n\nCreate an instance of the engine and perform speaker diarization on an audio file:\n\n```python\nimport pvfalcon\n\nfalcon = pvfalcon.create(access_key='${ACCESS_KEY}')\n\nprint(falcon.process_file('${AUDIO_PATH}'))\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://console.picovoice.ai/) and\n`${AUDIO_PATH}` to path an audio file.\n\nFinally, when done be sure to explicitly release the resources:\n\n```python\nfalcon.delete()\n```\n\n### C\n\nCreate an instance of the engine and perform speaker diarization on an audio file:\n\n```c\n#include \u003cstdbool.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\n#include \"pv_falcon.h\"\n\npv_falcon_t *falcon = NULL;\npv_status_t status = pv_falcon_init(\"${ACCESS_KEY}\", \"${MODEL_PATH}\", \u0026falcon);\nif (status != PV_STATUS_SUCCESS) {\n    // error handling logic\n}\n\nint32_t num_segments = 0;\npv_segment_t *segments = NULL;\nstatus = pv_falcon_process_file(falcon, \"${AUDIO_PATH}\", \u0026num_segments, \u0026segments);\nif (status != PV_STATUS_SUCCESS) {\n    // error handling logic\n}\n\nfor (int32_t i = 0; i \u003c num_segments; i++) {\n    pv_segment_t *segment = \u0026segments[i];\n    fprintf(\n            stdout,\n            \"Speaker: %d -\u003e Start: %5.2f, End: %5.2f\\n\",\n            segment-\u003espeaker_tag,\n            segment-\u003estart_sec,\n            segment-\u003eend_sec);\n}\n\npv_falcon_segments_delete(segments);\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from Picovoice Console, `${MODEL_PATH}` to path to\n[default model file](./lib/common/falcon_params.pv) (or your custom one), and `${AUDIO_PATH}` to path an audio file.\n\nFinally, when done be sure to release resources acquired:\n\n```c\npv_falcon_delete(falcon);\n```\n\n### Web\n\nInstall the web SDK using yarn:\n\n```console\nyarn add @picovoice/falcon-web\n```\n\nor using npm:\n\n```console\nnpm install --save @picovoice/falcon-web\n```\n\nCreate an instance of the engine using `FalconWorker` and diarize an audio file:\n\n```typescript\nimport { Falcon } from '@picovoice/falcon-web';\nimport falconParams from '${PATH_TO_BASE64_FALCON_PARAMS}';\n\nfunction getAudioData(): Int16Array {\n  // ... function to get audio data\n  return new Int16Array();\n}\n\nconst falcon = await FalconWorker.create('${ACCESS_KEY}', {\n  base64: falconParams,\n});\n\nconst { segments } = await falcon.process(getAudioData());\nconsole.log(segments);\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from [Picovoice Console](https://console.picovoice.ai/). Finally, when done release the resources using `falcon.release()`.\n\n### iOS\n\n\u003c!-- markdown-link-check-disable --\u003e\n\nThe Falcon iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Falcon-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`:\n\n\u003c!-- markdown-link-check-enable --\u003e\n\n```ruby\npod 'Falcon-iOS'\n```\n\nCreate an instance of the engine and perform speaker diarization on an audio_file:\n\n```swift\nimport Falcon\n\nlet falcon = Falcon(accessKey: \"${ACCESS_KEY}\")\n\ndo {\n    let audioPath = Bundle(for: type(of: self)).path(forResource: \"${AUDIO_FILE_NAME}\", ofType: \"${AUDIO_FILE_EXTENSION}\")\n    let segments = falcon.process(audioPath)\n} catch { }\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from Picovoice Console, `${AUDIO_FILE_NAME}` with the name of the audio file and `${AUDIO_FILE_EXTENSION}` with the extension of the audio file.\n\n### Android\n\nTo include the Falcon package in your Android project, ensure you have included `mavenCentral()` in your top-level `build.gradle` file and then add the following to your app's `build.gradle`:\n\n```groovy\ndependencies {\n    implementation 'ai.picovoice:falcon-android:${LATEST_VERSION}'\n}\n```\n\nCreate an instance of the engine and perform speaker diarization on an audio file:\n\n```java\nimport ai.picovoice.falcon.*;\n\nfinal String accessKey = \"${ACCESS_KEY}\"; // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)\ntry {\n    Falcon falcon = new Falcon.Builder()\n        .setAccessKey(accessKey)\n        .build(appContext);\n\n        File audioFile = new File(\"${AUDIO_FILE_PATH}\");\n        FalconSegment[] segments = falcon.processFile(audioFile.getAbsolutePath());\n\n} catch (FalconException ex) { }\n```\n\nReplace `${ACCESS_KEY}` with yours obtained from Picovoice Console, and `${AUDIO_FILE_PATH}` with the path to the audio file.\n\nFinally, when done make sure to explicitly release the resources:\n\n```java\nfalcon.delete()\n```\n\nFor more details, see the [Android SDK](./binding/android/README.md).\n\n## Releases\n\n### v1.0.0 — November 28th, 2023\n\n- Initial release.\n\n## FAQ\n\nYou can find the FAQ [here](https://picovoice.ai/docs/faq/general/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Ffalcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicovoice%2Ffalcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicovoice%2Ffalcon/lists"}