Giter Club home page Giter Club logo

python_wav's Introduction

python_wav

对音频文件的处理:音频信息,读取内容,获取时长,切割音频,pcm与wav互转

文章简介:公众号-Python疯子 https://mp.weixin.qq.com/s/Kw_n3RgYfZCn_0ZOJpaxHg

获取音频信息

ret = wav_infos(wav_path) print(ret)

读取音频文件内容

ret = read_wav(wav_path) print(ret)

获取音频时长(单位秒)

ret = get_wav_time(wav_path) print(ret)

音频切片,获取部分音频 时间的单位是毫秒

start_time = 13950 end_time = 15200 get_ms_part_wav(main_wav_path, start_time, end_time, part_wav_path)

音频切片,获取部分音频 时间的单位是秒

start_time = 35 end_time = 38 get_second_part_wav(main_wav_path, start_time, end_time, second_part_wav_path)

音频切片,获取部分音频 时间的单位是分钟和秒 样式:0:12

start_time = "0:35" end_time = "0:38" get_minute_part_wav(main_wav_path, start_time, end_time, minute_part_wav_path)

wav文件转为pcm文件

wav_to_pcm(wav_path, pcm_path)

pcm文件转为wav文件

pcm_to_wav(pcm_path, wav_path2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.