Archive for the ‘DSP’ Category

Aquila for visual studio 2012

Posted: May 1, 2013 in c++, DSP

I need to DSP capabilities for my project so I encountered this new library for dsp with c++.

at first glance it looks pretty good.

The final result I need it to pbuild Aquila code as dynamic librarues and use it in my Firebreath\Android\iPhone projects for DSP.

downloaded the source and put the following command in CMD (in the root directory where all the CMAKE files are):

cmake . -DCMAKE_INSTALL_PREFIX=”D:\Libs\aquila”

C:\Users\rmoshe\Downloads\zsiciarz-aquila-38a68e0\zsiciarz-aquila-38a68e0>cmake
aquila -DCMAKE_INSTALL_PREFIX=”D:\Libs\aquila”
CMake Error: The source directory “C:/Users/rmoshe/Downloads/zsiciarz-aquila-38a
68e0/zsiciarz-aquila-38a68e0/aquila” does not appear to contain CMakeLists.txt.
Specify –help for usage, or press the help button on the CMake GUI.

C:\Users\rmoshe\Downloads\zsiciarz-aquila-38a68e0\zsiciarz-aquila-38a68e0>cmake
. -DCMAKE_INSTALL_PREFIX=”D:\Libs\aquila”
— Building for: Visual Studio 11
— The CXX compiler identification is MSVC 17.0.50727.1
— Check for working CXX compiler using: Visual Studio 11
— Check for working CXX compiler using: Visual Studio 11 — works
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info – done
— The C compiler identification is MSVC 17.0.50727.1
— Check for working C compiler using: Visual Studio 11
— Check for working C compiler using: Visual Studio 11 — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— SFML: Could not locate : SFML_SYSTEM_LIBRARY_SHARED_NONDEBUG
— SFML: Could not locate : SFML_AUDIO_LIBRARY_SHARED_NONDEBUG
— SFML: Could not locate include directory
Components of SFML are missing!
— Could NOT find SFML (missing: SFML_LIBRARY SFML_INCLUDE_DIR)
CMake Warning at CMakeLists.txt:41 (message):
SFML was not found, wrappers and examples using SFML will not be built.
— Configuring done
— Generating done
— Build files have been written to: C:/Users/rmoshe/Downloads/zsiciarz-aquila-3
8a68e0/zsiciarz-aquila-38a68e0

I’m not afraid from the SFML warnings. I don’t need it anyways. I think its for testing.

I installed¬†MinGW as was instructed. installation complete. Added “C:\MinGW\bin” to my PATH in windows.

nothing works. I’m gonna find another solution ūüė¶

Building with¬†mingw32-make wasn’t successful and I don’t have more time to waste on it.


My solution: I added all Aquira sources to a Visual Studio DLL project and built it. worked well except for some small fixes. very easy to solve. built OK.

ūüôā

Advertisements

I used this projects as my reference to how record from the microhphone in Windows with c++:

http://www.relisoft.com/freeware/recorder.html

http://www.dreamincode.net/forums/topic/208153-sound-recorder-using-the-low-level-windows-api-in-c/

my WAVEFORMATEX values are:

wFormatTag 1 unsigned short (WAVE_FORMAT_PCM)
nChannels 1 unsigned short
nSamplesPerSec 11025 unsigned long
nAvgBytesPerSec 11025 unsigned long
nBlockAlign 1 unsigned short
wBitsPerSample 8 unsigned short
cbSize 0 unsigned short

In the event of PCM buffer input I call a callback function that uses this data from lpData in the given WAVEHDR .

The trick to get real useful values from this data (0 means silence) is to do a static cast to unsigend char * (reinterpret) and decrement 128 which is the biased zero.

unsigned char * lpData = reinterpret_cast<unsigned char *> (_lpData); 

for (int i=0;i<buffLen;i++)
{
       value + = abs(lpData[i]-128);
}