Skip to content

Commit

Permalink
Add voice activity detector module. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsimmisch authored Nov 5, 2023
1 parent 28f7703 commit c1c8a96
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cmake/FindFVAD.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
find_package(PkgConfig QUIET)
pkg_search_module(FVAD fvad)

find_path(FVAD_INCLUDE_DIR
NAMES fvad.h
HINTS
"${FVAD_INCLUDE_DIRS}"
"${FVAD_HINTS}/include"
PATHS /usr/local/include /usr/include
)

find_library(FVAD_LIBRARY
NAME libfvad.a
HINTS
"${FVAD_LIBRARY_DIRS}"
"${FVAD_HINTS}/lib"
PATHS /usr/local/lib /usr/lib
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FVAD DEFAULT_MSG FVAD_LIBRARY
FVAD_INCLUDE_DIR)

if(FVAD_FOUND)
set( FVAD_INCLUDE_DIRS ${FVAD_INCLUDE_DIR} )
set( FVAD_LIBRARIES ${FVAD_LIBRARY} )
else()
set( FVAD_INCLUDE_DIRS )
set( FVAD_LIBRARIES )
endif()

mark_as_advanced( FVAD_INCLUDE_DIRS FVAD_LIBRARIES )
6 changes: 6 additions & 0 deletions cmake/modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ if(DEFINED MODULES)
return()
endif()

find_package(FVAD)

set(MODULES
auloop
autotest
Expand All @@ -14,6 +16,10 @@ set(MODULES
qualify
)

if(FVAD_FOUND)
list(APPEND MODULES fvad)
endif()

if(DEFINED EXTRA_MODULES)
list(APPEND MODULES ${EXTRA_MODULES})
endif()
12 changes: 12 additions & 0 deletions modules/fvad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
project(fvad)

set(SRCS fvad.c)

if(STATIC)
add_library(${PROJECT_NAME} OBJECT ${SRCS})
else()
add_library(${PROJECT_NAME} MODULE ${SRCS})
endif()

target_include_directories(${PROJECT_NAME} PRIVATE ${FVAD_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${FVAD_LIBRARIES})
Loading

0 comments on commit c1c8a96

Please sign in to comment.