how to print the value of variable which is define in header file.?
-
#ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c
-
#ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c
First you need to create a function
pf
that takes an integer value and prints it somewhere. Given this and your other questions, I think you would benefit from studying a decent book on C/C++, or search the internet for some tutorials. You cannot learn C programming by just asking questions on this forum. -
First you need to create a function
pf
that takes an integer value and prints it somewhere. Given this and your other questions, I think you would benefit from studying a decent book on C/C++, or search the internet for some tutorials. You cannot learn C programming by just asking questions on this forum. -
Well it really does not help us if you do not show the exact code that you have a problem with. If you want to learn how to use
printf
correctly then I suggest studying the documentation[^]. -
#ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c
maibam debina wrote:
but error is generating undeclared details.
That is because you are using a structure or class reference for something that is a simple integer value. It should be just:
coefficients=NUM_OF_COEFFICIENTS;
printf("Num of ceptral coefficients=%d",coefficients); -
maibam debina wrote:
but error is generating undeclared details.
That is because you are using a structure or class reference for something that is a simple integer value. It should be just:
coefficients=NUM_OF_COEFFICIENTS;
printf("Num of ceptral coefficients=%d",coefficients); -
#ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c
I can only agree with Richard. I've had a look at some of your questions and found that you're lacking the most fundamental understanding on how to properly write and test a program in C. Please do yourself and everyone else a favor and use a proper C book or tutorial. One of the first links I found on that topic is this: http://www.cprogramming.com/tutorial/c-tutorial.html[^] . Read that tutorial, take your time to understand what it teaches you. Make sure to actually try out the program snippets. Learn how to set up your working environment: compiler, linker, debugger. Once you've done that you'll save a lot of time because you won't need to ask about such basic problems. Learning C will take a considerable amount of time. But not learning it properly will cost you even more time in the long run, and others as well!
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)