Add CMake build
Fix valgrind errors
Fix sample rate configuration