falcon开源程序是由深度学习提供支持的设备端说话人分类,是一个设备上的扬声器分类引擎,所有语音处理都在本地运行;说话人分类是自动语音识别和音频处理的基本步骤,侧重于识别和分离录音中的不同说话人。

​一、软件介绍

文末提供程序和源码下载

falcon开源程序是由深度学习提供支持的设备端说话人分类,是一个设备上的扬声器分类引擎,所有语音处理都在本地运行。

Falcon 是一个设备上的扬声器分类引擎。Falcon 是:

  • Private; All voice processing runs locally.
    私人;所有语音处理都在本地运行。
  • Cross-Platform:  跨平台:
    • Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64)
      Linux (x86_64)、macOS (x86_64、arm64)、Windows (x86_64、arm64)
    • Raspberry Pi (3, 4, 5)
      Raspberry Pi (3, 4, 5)
    • Android and iOS Android 和 iOS
    • Chrome, Safari, Firefox, and Edge
      Chrome、Safari、Firefox 和 Edge

二、什么是说话人分类?

     说话人分类是自动语音识别和音频处理的基本步骤,侧重于识别和分离录音中的不同说话人。其目标是将音频分成多个片段,同时精确识别说话者及其各自的说话间隔。

三、AccessKey 访问密钥

AccessKey 是您部署 Picovoice SDK(包括 Falcon)的鉴权和授权 Token。任何使用 Picovoice 的人都需要拥有有效的 AccessKey。您必须对 AccessKey 保密。您需要互联网连接才能使用 Picovoice 许可证服务器验证您的 AccessKey,即使说话人识别是 100% 离线运行的。

AccessKey also verifies that your usage is within the limits of your account. Everyone who signs up for Picovoice Console receives the Free Tier usage rights described here. If you wish to increase your limits, you can purchase a subscription plan.
AccessKey 还会验证您的使用量是否在账户限制范围内。注册 Picovoice Console 的每个人都将获得此处描述 Free Tier 的使用权限。如果您想提高限制,您可以购买订阅计划。

四、Demos 演示

Python Demo Python 演示

Install the demo package:
安装 demo 包:

pip3 install pvfalcondemo

Run the following in the terminal:
在终端中运行以下命令:

falcon_demo_file --access_key ${ACCESS_KEY} --audio_paths ${AUDIO_PATH}

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console.
替换为 ${ACCESS_KEY} 从 Picovoice 控制台获取的。

For more information about Python demos go to demo/python.
有关 Python 演示的更多信息,请转到 demo/python。

C Demo C 演示

Build the demo: 构建演示:

cmake -S demo/c/ -B demo/c/build && cmake --build demo/c/build

Run the demo: 运行演示:

./demo/c/build/falcon_demo -a ${ACCESS_KEY} -l ${LIBRARY_PATH} -m ${MODEL_PATH} ${AUDIO_PATH}

Web Demo Web 演示

From demo/web run the following in the terminal:
在 demo/web 中,在终端中运行以下命令:

yarn
yarn start

(or) (或)

npm install
npm run start

Open http://localhost:5000 in your browser to try the demo.
在浏览器中打开 http://localhost:5000 以尝试演示。

iOS Demo iOS 演示

To run the demo, go to demo/ios/FalconDemo and run:
要运行演示,请转到 demo/ios/FalconDemo 并运行:

pod install

Replace let accessKey = "${YOUR_ACCESS_KEY_HERE}" in the file ViewModel.swift with your AccessKey.
将文件中的 ViewModel.swift 替换为 let accessKey = "${YOUR_ACCESS_KEY_HERE}" 您的 AccessKey .

Then, using Xcode, open the generated FalconDemo.xcworkspace and run the application.
然后,使用 Xcode 打开生成的 FalconDemo.xcworkspace 应用程序并运行应用程序。

Android Demo Android 演示

Using Android Studio, open demo/android/FalconDemo as an Android project and then run the application.
使用 Android Studio 打开 demo/android/FalconDemo 作为 Android 项目,然后运行应用程序。

Replace "${YOUR_ACCESS_KEY_HERE}" in the file MainActivity.java with your AccessKey.
将文件中的 MainActivity.java 替换为 "${YOUR_ACCESS_KEY_HERE}" 您的 AccessKey .

SDKs 开发工具包

Python 蟒

Install the Python SDK:
安装 Python SDK:

pip3 install pvfalcon

Create an instance of the engine and perform speaker diarization on an audio file:
创建引擎的实例并对音频文件执行扬声器分类:

import pvfalcon

falcon = pvfalcon.create(access_key='${ACCESS_KEY}')

print(falcon.process_file('${AUDIO_PATH}'))

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${AUDIO_PATH} to path an audio file.
替换为 ${ACCESS_KEY} 从 Picovoice 控制台获取的 URL,并 ${AUDIO_PATH} 对音频文件进行路径查找。

Finally, when done be sure to explicitly release the resources:
最后,完成后,请务必显式释放资源:

falcon.delete()

C

Create an instance of the engine and perform speaker diarization on an audio file:
创建引擎的实例并对音频文件执行扬声器分类:

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

#include "pv_falcon.h"

pv_falcon_t *falcon = NULL;
pv_status_t status = pv_falcon_init("${ACCESS_KEY}", "${MODEL_PATH}", &falcon);
if (status != PV_STATUS_SUCCESS) {
    // error handling logic
}

int32_t num_segments = 0;
pv_segment_t *segments = NULL;
status = pv_falcon_process_file(falcon, "${AUDIO_PATH}", &num_segments, &segments);
if (status != PV_STATUS_SUCCESS) {
    // error handling logic
}

for (int32_t i = 0; i < num_segments; i++) {
    pv_segment_t *segment = &segments[i];
    fprintf(
            stdout,
            "Speaker: %d -> Start: %5.2f, End: %5.2f\n",
            segment->speaker_tag,
            segment->start_sec,
            segment->end_sec);
}

pv_falcon_segments_delete(segments);

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console, ${MODEL_PATH} to path to default model file (or your custom one), and ${AUDIO_PATH} to path an audio file.
替换为 ${ACCESS_KEY} 从 Picovoice 控制台获取的, ${MODEL_PATH} 以默认模型文件(或自定义模型文件)的路径,以及 ${AUDIO_PATH} 音频文件的路径。

Finally, when done be sure to release resources acquired:
最后,完成后,请务必释放获取的资源:

pv_falcon_delete(falcon);

Web 蹼

Install the web SDK using yarn:
使用 yarn 安装 Web SDK:

yarn add @picovoice/falcon-web

or using npm: 或使用 npm:

npm install --save @picovoice/falcon-web

Create an instance of the engine using FalconWorker and diarize an audio file:
使用 FalconWorker 和分类音频文件创建引擎实例:

import { Falcon } from '@picovoice/falcon-web';
import falconParams from '${PATH_TO_BASE64_FALCON_PARAMS}';

function getAudioData(): Int16Array {
  // ... function to get audio data
  return new Int16Array();
}

const falcon = await FalconWorker.create('${ACCESS_KEY}', {
  base64: falconParams,
});

const { segments } = await falcon.process(getAudioData());
console.log(segments);

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. Finally, when done release the resources using falcon.release().
替换为 ${ACCESS_KEY} 从 Picovoice 控制台获取的。最后,完成后,使用 falcon.release() 释放资源。

iOS iOS 设备

The Falcon iOS binding is available via CocoaPods. To import it into your iOS project, add the following line to your Podfile and run pod install:
Falcon iOS 绑定可通过 CocoaPods 获得。要将其导入 iOS 项目,请将以下行添加到 Podfile 中并运行 pod install :

pod 'Falcon-iOS'

Create an instance of the engine and perform speaker diarization on an audio_file:
创建引擎的实例并在 audio_file 上执行扬声器分类:

import Falcon

let falcon = Falcon(accessKey: "${ACCESS_KEY}")

do {
    let audioPath = Bundle(for: type(of: self)).path(forResource: "${AUDIO_FILE_NAME}", ofType: "${AUDIO_FILE_EXTENSION}")
    let segments = falcon.process(audioPath)
} catch { }

Replace ${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.
替换为 ${ACCESS_KEY} 从 Picovoice Console ${AUDIO_FILE_NAME} 获取的 ${AUDIO_FILE_EXTENSION} 音频文件名称和音频文件的扩展名。

Android 人造人

To 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:
要将 Falcon 包包含在 Android 项目中,请确保您已包含在 mavenCentral() 顶级 build.gradle 文件中,然后将以下内容添加到应用程序的 build.gradle :

dependencies {
    implementation 'ai.picovoice:falcon-android:${LATEST_VERSION}'
}

Create an instance of the engine and perform speaker diarization on an audio file:
创建引擎的实例并对音频文件执行扬声器分类:

import ai.picovoice.falcon.*;

final String accessKey = "${ACCESS_KEY}"; // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
try {
    Falcon falcon = new Falcon.Builder()
        .setAccessKey(accessKey)
        .build(appContext);

        File audioFile = new File("${AUDIO_FILE_PATH}");
        FalconSegment[] segments = falcon.processFile(audioFile.getAbsolutePath());

} catch (FalconException ex) { }

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console, and ${AUDIO_FILE_PATH} with the path to the audio file.
替换为 ${ACCESS_KEY} 从 Picovoice Console 获取的 Delete,并 ${AUDIO_FILE_PATH} 替换为音频文件的路径。

Finally, when done make sure to explicitly release the resources:
最后,完成后,请确保显式释放资源:

falcon.delete()

For more details, see the Android SDK.
有关更多详细信息,请参阅 Android SDK。

五、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:https://github.com/Picovoice/falcon

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值