Coder Social home page Coder Social logo

qt_audio's Introduction

C++变音程序

基于C++和Qt4.8.6的变音程序

2016.07.21

这几天整理程序时,把几个源代码集中上传到github上
我们实验室有人开发机器人项目,其中用到变音程序,可以在后台讲话,将语音变音后传输到前台,就听不出讲话人的身份了。觉得很有趣,就想也写一个出来。
这里实现了基本的功能,即变音部分。语音数据包的传输功能还没实现。

使用:

  • 上传了Windows下VS2010+Qt4.8.6环境的C++程序。由于使用qt,应该方便移植到Linux上。
  • 程序打开后就是一个空白界面,如果想完全在后台运行,可将窗口隐藏。
  • 程序在运行时,会采集默认音频输入设备的PCM声音数据,进过变音处理后,从默认音频输出设备输出。如果直接使用笔记本电脑的麦克风,会有回波问题。使用带麦克风的耳机可以解决这个问题。最好的方案是使用外接麦克风和音响。

程序结构:

  • 这个小程序结构很简单。对音频的处理使用了Qt中的QAudioInput、QAudioOutput类,配合QByteArray类(这里起缓冲区的作用)。
  • 变音部分使用了SoundTouch库。这个库可以实现声音数据的变调、变速。底层应该是用了频谱搬移。
  • Qt的音频处理部分直接参考了这个博客:http://blog.csdn.net/jdh99/article/details/39204129
  • 使用SoundTouch库时发现一个问题,它的receiveSamples函数是异步处理的。即放入的音频数据不是马上就能处理好取出的,而是积累到一定长度再处理、返回,所以receiveSamples有时取不到数据,有时能取到比刚刚放入的数据更长的结果数据。

qt_audio's People

Watchers

James Cloos avatar Jukat avatar

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.