views:

614

answers:

3

Hi everyone,

I'm an Electronics and Telecommunications student, next to my graduation. I'm gonna work on a project that involves my knowledge about DSP, music and audio in general. I allready know all the basic mathematic instruments and all the stuff I need to manage it, such as FFT, circular convolution ecc ecc.

I want to learn C++ programming basically for one reason: it's very important in the professional world!!! And I think it's one of the most used to write applications working with audio, especially when it's about real time processing.

Ok, after this small introduction I would like to know first, which are the most used libraries to work with audio processing in c++?? I was longer looking on the web but i couldn't find a lo of working stuff. (I work under linux with eclipse CDT enviroment).

Then I would like to know if there are good sources to learn how to write some working code, such as for example how to write a simple low pass filter. Basically now i will not write real time applications, I would like to start from the processing of a WAV file, or even better an MP3 file, so basically on vectors of samples.

Let's say that basically for now I would like to extract the waveform from an audio file, and save it to a thumbnail or to a PNG image.

Ok, for now I think it's all I would need.

Any ideas, advices, libraries, books, interesting sources about that?

Thanks a lot in advance for any kind of answer.

Giovanni.

+2  A: 

I would suggest for you to write your own WAVE file reader and writer in C++, without relying on external libraries. The WAVE format is fairly straight forward, at least if you only intend on supporting the most common wave files.

Then you'll have access to the audio data, which you can easily manipulate in C++. I would recommend starting by modifying the volume, the number of channels to calculating statistics on the audio. Creating a PNG of the audio waveform requires some more advanced C++ skills...

Martin
Ok! Very good, it's something can be interesting to start with. How can I do that? are there any tutorials? I know how WAV files are structured, but I don't know how to open audio files on C++, is that the normal file stream opening? Or there is something more i would need?
Cesko82
It is a normal file stream. You can read and write as you wish. But I would recommend you to have a better look at c++ first, rather then rushing into DSP without knowing some basics of that programming language. You could easily run into number of problems. Have you programmed in any other languages?
Adi
yes, i did it on python, and on java sometimes. I allready wrote a routin with python using the matlab like libraries, but that takes too much ram just to draw a waveform because uses a video library that puts the video card driver at work. I just wanna export waveforms on a file for now, an maybe mixing together two audio files.
Cesko82
Exporting a waveform means processing audio signal and drawing it to a bitmap and then saving a bitmap to a file. So your second problem would be plotting the signal onto the bitmap. I would suggest you to use some plotting library as there's a quite of work to do the plotting yourself.
Adi
+1  A: 

I've used BASS with good results (there's a C/C++ API you can use).

Ace
that sounds nice, but i cannot find it on repositories, how can i manage it on my karmic koala distro?
Cesko82
Ah, sorry, somehow I missed that you were running Linux. Here (http://www.un4seen.com/forum/?topic=8682.0) is an official build you can download. Also, something to note about BASS: it's not open source and free only for non-commercial use, so it may or may not be what you're looking for, but it's worth checking out.
Ace
+1  A: 

Checkout this link which will give you some information on the available (commercial and open source) audio editing softwares.

Some interesting open source audio editing tools which are written in c++,

  1. Audacity
  2. LMMS
  3. Qtractor
  4. Ardour
  5. Rosegarden

C++ library for audio processing.

  1. SndObj
  2. The Synthesis ToolKit in C++

C++ Code and links related Filters and audio processing..

C++ code for Filter,Audio Processing

Code Guru,Low pass filter

RP