How to output a frequency 1kHz and power/volume = 60% in Linux (Ubuntu)?
I need sample code in C/C++. Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at the portaudio library. http://www.portaudio.com/
It is very easy to use, cross platform and comes with lots of little example programs. Among other things you’ll find one that synthesizes and plays a sine-wave.
Changing frequency and volume is trivial.. If I remember right the example was just a single page of code including initialization and everything.