opensmile简介和安装过程中遇到的问题记录

  1. 定义:一种提取音频特征的工具
  2. 优点:
    1. 可以在新数据到达时以增量方式提取特征
    2. 几乎所有在特征提取过程中生成的中间数据(如窗口音频数据、频谱等)都可以访问并保存到文件中,一遍进行可视化或进一步处理
  3. 特点:
    1. 支持的文件格式:音频文件wav,文本数据文件csv(逗号分隔值、电子表格格式),weka数据挖掘得到的arff格式,HTK(隐马尔科夫工具包)参数文件,二进制特征数据的简单二进制浮点矩阵格式
    2. 为了兼容,官方二进制文件不是使用ffmpeg支持构建的,所以压缩格式(如mp3,mp4,ogg)存储的音频需要转换为未压缩的wave格式,然后才能使用opensmile进行分析。否则需要自行构建具有ffmpeg支持的opensmile
  4. 应用领域:语音识别(特征提取前端,关键字发现等),情感计算领域(情感识别),音乐信息检索(和弦识别,节拍trace)
  5. 分类:
    1. 用c++编写的:安装需要clone源码并使用cmake安装,使用一些指令来使用。
    2. python模块(下面说明安装步骤以及过程中遇到的问题)
  6. 源码安装opensmile(linux):
    git clone https://github.com/audeering/opensmile
    
    cd opensmile
    
    bash build.sh
    
    vim /etc/profile (修改这个文件需要root权限)
    
    export PATH="smilextract绝对路径:$PATH" (加到profile文件尾部)
    
    source /etc/profile
    
    SMILExtract -h  (检测是否安装成功)
    
    
    (可选)对于一些使用可能需要调整SMILExtract的位置(复制到到opensmile的根目录下),以及修改opensmile中opensmile_config_path的定义
  7. python安装及调用:
    1. 安装:
      pip install opensmile
    2. 遇到的报错:
      1. ERROR: Cannot uninstall ‘PyYAML’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
        1. 解决:在安装的包后面加上 --ignore-installed PyYAML,即
          pip install opensmile --ignore-installed PyYAML
      2. ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

        wandb 0.12.18 requires GitPython>=1.0.0, which is not installed.
        datasets 2.2.2 requires aiohttp, which is not installed.
        datasets 2.2.2 requires multiprocess, which is not installed.
        datasets 2.2.2 requires pyarrow>=6.0.0, which is not installed.
        pytorch-lightning 0.9.0 requires tensorboard==2.2.0, but you have tensorboard 2.9.1 which is incompatible.
        ltp 4.1.5.post2 requires transformers<=4.7.0,>=4.0.0, but you have transformers 4.19.4 which is incompatible.
        huggingface-hub 0.7.0 requires packaging>=20.9, but you have packaging 20.4 which is incompatible.
        datasets 2.2.2 requires fsspec[http]>=2021.05.0, but you have fsspec 0.8.3 which is incompatible.
        1. 解决:(实际就是根据错误提示将缺的依赖进行安装)

          pip install wandb
          pip install pytorch-lightning 
          pip install --user datasets

    3.  测试程序:
      # 为预定义特征集的功能设置一个特征提取器
      import opensmile
      smile=opensmile.Smile(
          feature_set=opensmile.FeatureSet.eGeMAPSv02, # 特征集
          feature_level=opensmile.FeatureLevel.Functionals # 特征级别,比如低级,高级等
      )
      smile.feature_names

      输出:

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值