voicerecog

package module
v0.0.0-...-11b2c39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 9 Imported by: 0

README

VoiceRecog

介绍

语音识别模块

软件架构

本程序只支持在 macOS 上运行

  • 启动 ffmpeg 进程,捕捉麦克风音频流,并转换为 pcm_s16le 格式
  • 调用 阿里云语音识别 接口进行实时识别
  • 投递识别结果到 HTTP 端点

配置文件

aliyun-nls-url wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1
aliyun-access-key-id xxxxxxxx
aliyun-access-key-secret xxxxxxxxx
aliyun-nls-app-key xxxxxxx
target-url https://voicerecog.tok715.example.com/master/submit

使用方法

  1. 安装 ffmpeg

  2. 列出本机可用的音频输入设备

    go run ./cmd/voicerecog -check
    
  3. 启动程序

    go run ./cmd/voicerecog -conf voicerecog.conf -device 2
    

许可证

TOK715 Developers, MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, output chan string, opts Options) (err error)

Types

type AliyunSpeechTranscriptionResult

type AliyunSpeechTranscriptionResult struct {
	Payload struct {
		Result string `json:"result"`
	} `json:"payload"`
}

type Options

type Options struct {
	Config *nls.ConnectionConfig
	Device string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL