当前位置:   article > 正文

python raw data_Python open raw audio data file

python 原始音频数据(raw audio)

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

I have these files with the extension ".adc". They are simply raw data files. I can open them with Audacity using File->Import->Raw data with encoding "Signed 16 bit" and sample rate "16000 Khz".

I would like to do the same with python. I think that audioop module is what I need, but I can't seem to find examples on how to use it for something that simple.

The main goal is to open the file and play a certain location in the file, for example from the second 10 to the second 20. Is there something out there for my task ?

Thanx in advance.

回答1:

For opening the file, you just need file(). For finding a location, you don't need audioop: you just need to convert seconds to bytes and get the required bytes of the file. For instance, if your file is 16 kHz 16bit mono, each second is 32,000 bytes of d

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/967072
推荐阅读
相关标签
  

闽ICP备14008679号