|
#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
coefficients=(details.NUM_OF_COEFFICIENTS);
printf("Num of ceptral coefficients=%d",coefficients);
but error is generating undeclared details.
modified 30-Aug-14 5:58am.
|
|
|
|
|
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.
|
|
|
|
|
pf i wrote is not function its printf()
|
|
|
|
|
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[^].
|
|
|
|
|
Please have a watch upon my code ..
|
|
|
|
|
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);
|
|
|
|
|
Thank you Richard ..hav a nice day
|
|
|
|
|
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)
|
|
|
|
|
This needs to be removed
-- modified 29-Aug-14 12:11pm.
|
|
|
|
|
Not heard of that, and I cannot see what use it is. Why not just run the original in a command window to start with?
|
|
|
|
|
|
I still don't see the point. All of those functions will run perfectly in their own console window so what is the benefit of "It"?
|
|
|
|
|
|
|
If you are learning to code, then asking others to code for you is not the way to go. If you are having trouble getting started, you should put some effort into making the game yourself, and then ask when you run into problems.
|
|
|
|
|
I want to make a log with errors during the execution of my app. I'm trying to write an event to the windows Event Viewer with a VCL form application with C++ Builder XE5.
I'm using Vcl.SvcMgr.TEventLogger class.
The code in the header file is :
TEventLogger *Event;
The code in the cpp file is :
Event=new TEventLogger("MySource");
Event->LogMessage("MyMessage");
But beside my message, in the error description in the Event Viewer there is a message : "The description for Event ID 0 from source MySource cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted." . How can I remove that description and write only the message that I want? Should I be using other C++ class? I couldn't find any documentation about this class. The idea of using Event Viewer is that when the application is running on an user with restricted rights he won't be able to write to files, meaning I can't just type into a ".txt" file. If anyone else has a different idea how to make a log with errors, please share!
|
|
|
|
|
If I remember corrctly, you don't pass the message to Event Viewer directly, but you pass an application name and message id. You need a DLL that contains the texts to the ID (don't ask me in what format). And you need a specific registry key (in local machine I think) pointing the Event Viewer to the path of the DLL. We also used this approach long ago in one of our applications but aren't using it anymore because it's so complicated.
I would suggest the user needs to at least one directory where he/she has write permission. You could then enter the directory into some kind of ini file, read it on application start and write the log file into that directory.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Hi i am writing a simple app with doc/viw architecture, now i have to buttons in the Outlook bar "Folders" and "Calendar" now i want that when restart the app the selected pane will be always the 0 -> "Folders" now i tried this:
CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)m_wndNavigationBar.GetUnderlyingWindow();
pOutlookBar->SetActiveTab(0);
After this nothing happen. Why this?
i wait for your precious response
Giovanni
|
|
|
|
|
I want to write a adapter which can convert non static member functions to C-sytle function pointers. Here is what I got now(see the following code snippet), but the current solution is not general. I want to make
int (T::*Func)(int) accept variable arguments. but i'm stuck here? anybody can help me?
and it's necessary to make
int f() and
int display have the same signature.
The final goal is Interfacing C++ member functions with C libraries.
class StoreVals
{
int val;
public:
int display(int k) { cout << k << endl; return 0; }
};
template<class T, int (T::*Func)(int) >
class CObjectT
{
public:
static int f(int i)
{
T obj;
return (obj.*Func)(i);
}
};
void main()
{
CObjectT<StoreVals, &StoreVals::display>::f(7);
auto function_t = &CObjectT<StoreVals, &StoreVals::display>::f;
cout << typeid(function_t).name() << endl; }
|
|
|
|
|
Falconapollo wrote: The final goal is Interfacing C++ member functions with C libraries.
If you want your C++ code to call C libraries then you use
extern "C" {
...// C code and/or declarations.
}
If you want C libraries to call your C++ code then you must provide a C interface to it.
|
|
|
|
|
I have a PDF. If I use this
CString Path = GetPath("manual.pdf");
ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL);
The PDF executes. But if I then use
Path += "#page=17";
ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL);
or anything similar, I cant get the PDF to execute. I want the PDF to
execute and jump to a specific page. I found solutions, I think, where
I can execute the adobe.exe file and the path, but I dont know where
adobe.exe is located on these computers. Is there any way to execute
a PDF without knowing where the adobe executable is at?
Please, any response any one can give me will be greatly appreciated.
|
|
|
|
|
I suspect you can't open it to a specific page without knowing where Acrobat resides, but no matter - you can find that out from the registry apparently.
If you have a look at the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe\ you can get the full-path of the exe.
From there, it's seems to be just a matter of passing that file to shell execute along with using a parameter that includes (1) the full path to the pdf doc and (2) the desired page num.
Anyhoo - here's my source: http://www.devhut.net/2013/12/04/vba-open-a-pdf-to-a-specific-page/[^]
|
|
|
|
|
The third parameter in the call to ShellExecute [^] can be used to pass the extra parameters to the called application. All you need to do is check Adobe reader for the format of those parameters.
|
|
|
|
|
Another thing to think about is whether the computers you are targetting have Adobe reader installed at all. Personally, I use SumatraPDF for viewing PDFs, but there is a Microsoft reader app (its name escapes me right now), Foxit Reader, and probably others. Each of them could have different ways to specify the page to show first.
|
|
|
|
|
What is the net value of Path ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|