我过去一直在使用Audiolab导入声音文件,而且效果很好.然而:
-
In [2]: from scikits import audiolab
--------------------------------------------------------------------
ImportError Traceback (most recent call last)
C:\Python26\Scripts\<ipython console> in <module>()
C:\Python26\lib\site-packages\scikits\audiolab\__init__.py in <module>()
23 __version__ = _version
24
---> 25 from pysndfile import formatinfo, sndfile
26 from pysndfile import supported_format, supported_endianness, \
27 supported_encoding, PyaudioException, \
C:\Python26\lib\site-packages\scikits\audiolab\pysndfile\__init__.py in <module>()
----> 1 from _sndfile import Sndfile, Format, available_file_formats, available_encodings
2 from compat import formatinfo, sndfile, PyaudioException, PyaudioIOError
3 from compat import supported_format, supported_endianness, supported_encoding …Run Code Online (Sandbox Code Playgroud) 我有以下数组
a = [1, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 9, 8, 7,0,10,11]
Run Code Online (Sandbox Code Playgroud)
我希望找到连续值为零的数组的开始和结束索引,对于输出上方的数组,如下所示
[3,8],[12,15],[19]
Run Code Online (Sandbox Code Playgroud)
我想尽可能高效地做到这一点.
我有许多音频文件,我想在语音开始和结束时自动添加时间戳。因此,话语开始时的“开始”时间戳。以及话语结束时的“停止”时间戳。
喜欢:
start,stop
0:00:02.40,0:00:11.18
0:00:18.68,0:00:19.77
...
Run Code Online (Sandbox Code Playgroud)
我测试了以下解决方案,它工作正常:使用静音检测分割音频文件问题是我只能从中获取块,这使得将时间戳与原始音频进行匹配有点困难
任何正确方向的解决方案或推动都将受到高度赞赏!