当前位置: 首页 > news >正文

免费建网站哪个模板多网站设计的性能需求

免费建网站哪个模板多,网站设计的性能需求,随州网站建设学习,网站如何绑定二级域名概述 paddlespeech是百度飞桨平台的开源工具包,主要用于语音和音频的分析处理,其中包含多个可选模型,提供语音识别、语音合成、说话人验证、关键词识别、音频分类和语音翻译等功能。 本文介绍利用ps中的asr功能实现批量处理音频文件的demo。…

概述

paddlespeech是百度飞桨平台的开源工具包,主要用于语音和音频的分析处理,其中包含多个可选模型,提供语音识别、语音合成、说话人验证、关键词识别、音频分类和语音翻译等功能。

本文介绍利用ps中的asr功能实现批量处理音频文件的demo。

环境

centos 7.9

Python 3.10.3

paddlepaddle 2.5.1

paddlespeech 1.4.1

demo代码

demo的代码如下,使用python3.10版本运行。

# -*- coding: utf-8 -*-

#required python3.10

###paddlespeech asr demo

# paddlespeech asr -y --lang zh --model conformer_wenetspeech --input $audiofile

### demo基本的业务流程

### 给定目录,扫描目录下的音频文件,对音频文件进行asr接口操作,写入对应的结果文件

import os

from paddlespeech.cli.asr.infer import ASRExecutor

import soundfile as sf

srcPath = r'/home/admin/test'

resultFile = r'/home/admin/test/asr-result-file.txt'

##打开结果文件

rfile = open(resultFile, 'a')

##获取asr对象

asr = ASRExecutor()

for filename in os.listdir(srcPath):

    if filename.endswith('.wav') or filename.endswith('.mp3'):

        audio_file_path = os.path.join(srcPath, filename)

        ##获取文件参数,计算音频长度

        audio_data, sample_rate = sf.read(audio_file_path)

        duration = len(audio_data) / sample_rate

       

        ##当前的asr接口不能处理超过50秒的音频文件,自动跳过

        if duration >= 50:

            resultStr = 'srcFile:{}, duration >= 50, skip.'.format(audio_file_path)

            print(resultStr)

            rfile.write(resultStr + '\n')

        else:

            result = asr(audio_file=audio_file_path, model='conformer_wenetspeech', lang='zh', force_yes='y')

            print('srcFile:{}, asrResult:{}.'.format(audio_file_path, result))

            rfile.write('srcFile:{}, asrResult:{}.\n'.format(audio_file_path, result))

rfile.close()

测试

demo的测试结果如下。

$ python3 ps-asr-demo.py

/usr/local/python3/lib/python3.10/site-packages/librosa/core/constantq.py:1059: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.

Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

  dtype=np.complex,

2023-09-11 16:10:12.299 | INFO     | paddlespeech.s2t.modules.embedding:__init__:150 - max len: 5000

/usr/local/python3/lib/python3.10/site-packages/paddle/fluid/dygraph/math_op_patch.py:275: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int64, but right dtype is paddle.bool, the right dtype will convert to paddle.int64

  warnings.warn(

srcFile:/home/admin/test/zh.wav, asrResult:我认为跑步最重要的就是给我带来了身体健康.

srcFile:/home/admin/test/en.wav, asrResult:那摘了的标准.

[2023-09-11 16:10:20,223] [ WARNING] - The sample rate of the input file is not 16000.

                             The program will resample the wav file to 16000.

                             If the result does not meet your expectations,

                             Please input the 16k 16 bit 1 channel wav file.

/usr/local/python3/lib/python3.10/site-packages/paddle/fluid/dygraph/math_op_patch.py:275: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int64, but right dtype is paddle.bool, the right dtype will convert to paddle.int64

  warnings.warn(

srcFile:/home/admin/test/output.wav, asrResult:你好欢迎使用百度非讲深度学习框架.

srcFile:/home/admin/test/test-long-file.mp3, duration >= 50, skip.

...

总结

ps的asr功能中有多个模型可选,目前测试中的“conformer_wenetspeech”识别准确率较高。

识别速度有待提高,音频长度的限制也待解决。

空空如常

求真得真

http://www.yayakq.cn/news/575871/

相关文章:

  • 做网站后期自己可以维护吗一般注册公司多少钱
  • 网站开发需要的编程软件品牌运营总监
  • 好的做网站公司网站建设报价单ppt
  • 服务商平台登录宁波受欢迎全网seo优化
  • 鞍山网站制作招聘网深圳龙华建网站
  • 网站后台界面设计静态网站做新闻系统
  • 优化排名对网站不好阜宁县住房城乡建设局网站
  • 垂直汽车网站做电商的优势成都官网seo厂家
  • 凡客诚品的网站特色网站 建设制作菜鸟教程
  • 自己做网站可以揽业务吗基金会网站建设
  • 上海做网站的公司电话桂林市市长
  • 做网站网页app设计欣赏网站
  • 我的世界大盒子怎么做视频网站合肥seo网站优化
  • 网站制作资料收集莒县城乡建设局网站
  • 免费按模板制作微网站银行收取网站建设费的会计科目
  • 杭州网站设计工作室丽水网站建设哪家好
  • 网站建设价格受哪些影响深圳网站建设网络
  • 黄冈市住房和城乡建设厅网站威联通WordPress
  • 张扬网站建设购买域名后如何建立网站
  • 东莞网站优化效果如何公司做网站该注意哪些
  • 网站代码关键词标题镇江网站建设工程
  • 创新的赣州网站建设百度验证网站
  • 网站为什么要备案商务网站建设与维护考试
  • 怎么让网站收录在google企业名录查询器免费版
  • 昆明电商网站建设平面ui设计网站
  • 铁岭做网站一般多少钱绵阳网站建设联系电话
  • 凡科建站怎么建网站做效果图的网站有哪些
  • 做电商网站的上海公司亚马逊虚拟主机做网站
  • 网站建设详细需求文档建设厅网站账户名忘了怎么查
  • 杭州如何设计公司网站深圳界面设计