diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2111603..ae8f6e6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -101,6 +101,9 @@ target_link_libraries(nnet2f32 lpcnetfreedv m) add_executable(sw2packedulaw sw2packedulaw.c) target_link_libraries(sw2packedulaw lpcnetfreedv m) +add_executable(thash thash.c) +target_link_libraries(thash lpcnetfreedv m) + install(TARGETS lpcnet_enc lpcnet_dec RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/lpcnet.c b/src/lpcnet.c index 7a5119c..9f3f059 100644 --- a/src/lpcnet.c +++ b/src/lpcnet.c @@ -274,8 +274,3 @@ void lpcnet_synthesize(LPCNetState *lpcnet, short *output, float *features, int start = 0; } -static char git_hash[] = GIT_HASH; -char *lpcnet_get_hash(void) { - return git_hash; -} - diff --git a/src/lpcnet_freedv.c b/src/lpcnet_freedv.c index 823fcdc..fe154ea 100644 --- a/src/lpcnet_freedv.c +++ b/src/lpcnet_freedv.c @@ -80,3 +80,9 @@ void lpcnet_dec(LPCNetFreeDV *lf, char *frame, short* pcm) int lpcnet_samples_per_frame(LPCNetFreeDV *lf) { return FRAME_SIZE*lf->q->dec; } int lpcnet_bits_per_frame(LPCNetFreeDV *lf) { return lf->q->bits_per_frame; } + +static char git_hash[] = GIT_HASH; +char *lpcnet_get_hash(void) { + return git_hash; +} + diff --git a/src/thash.c b/src/thash.c new file mode 100644 index 0000000..5b60f2e --- /dev/null +++ b/src/thash.c @@ -0,0 +1,19 @@ +/*---------------------------------------------------------------------------*\ + + FILE........: thash.c + AUTHOR......: David Rowe + DATE CREATED: July 2020 + + Simple test program for LPCNet API get hash function + +\*---------------------------------------------------------------------------*/ + +#include +#include "lpcnet_freedv.h" + +int main(void) { + printf("%s\n", lpcnet_get_hash()); + return 0; +} + +