|
Voice/sound communication between PCs is big-business these days so it's unlikely you are going
to have the code given to you, especially if it's good code.
There are some things you need to deal with:
1) Latency. Your sallest buffer size will determine your minimum latency. If you're capturing
or playing audio with 500ms buffer chunks then you have a minimum latency of 500ms (1000ms if
using 500ms buffers for both capture and playback). Solution - keep buffer granularity as small
as possible.
2) Clock drift. Clocks are different on every machine. Generally you'll capture and playback
audio at the same sample rate. If the clock used for timing on the capture side varies from the
one used for playback then your audio drifts over time - the latency increases or decreases.
I have a machine that the latency increases 1s every 10 minutes or so capturing from one device
and playing back on a different device on the same machine. Unnaceptable for real-time
Solution - you'll think of something. It's a main part of my business so I'm not giving my
solution away - Google search on "clock drift" may yields some hints.
3) Network jitter. With full bandwidth available at all times it's no problem. When this is not
the case (often) it's a problem, causing jitter in the playback (crackles/pops/noise caused by
gaps in the audio stream. You'll probably need to account for this by using some kind of jitter
buffer on at least the playback side. A jitter buffer will add latency so consider that in the
overall design.
|
|
|
|
|
To create a safest release executable, what options we should set when compile vc++ project in vc .Net 2003?
Thanks & Regards,
Suman
|
|
|
|
|
What do you mean by 'safest' ? If you statically link to everything, like MFC, you get a bigger EXE with no external dependancies, is that what you mean ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
By 'safest' I meant, compiler should warn if there is any possibility of using uninitialized variable, or something else which will cause runtime error, and whatever the compiler can detect.
Thanks & Regards,
Suman
|
|
|
|
|
During a compilation of C/C++ file, how can i know that the caller project(project which contains that cpp file) is using MFC or not.
Warm Regards,
Mushq
|
|
|
|
|
Check the _MFC_VER macro, if it's an MFC project, that macro is defined as the MFC version.
|
|
|
|
|
Thanks for quick reply, and it is woking fine.
Regards,
Mushq
|
|
|
|
|
I am a new student. I have been through two classes, intro to programing in C++ and then C++ data structures. I bought a book on the STL Library called the Standard Template Library. They said the book was for beginners but I can't understand any of it. Does anyone know where I can find a book for BEGINNERS that is easy to understand.
Thanks
IRS
|
|
|
|
|
Perhaps you should have read a little of the book before buying it. The best person to ask about which book to buy is your teacher. He/She will know of a good book that is suitable for use along side his/her course.
|
|
|
|
|
Thats a good point but unfortuantely I live in Idaho, North Idaho to be exact in a little college town. We dont even have a book store. So I had to purchase it online. The only thing I could read was the descriptions. While you make a good point, my resources are extremely limited. I did ask my teacher he said he didnt know. Hints why I posted this message
thanks
irs
|
|
|
|
|
Standard Template Library is a powerful but quite advanced topic. Do you really need to use STL or you only need a good understanding of C++ (in fact a good understanding of C++ is at least recommended before starting to learn STL). There are also free resources online (e.g. Bruce Eckel's books).
By the way, it's a long time I wish to spend a holyday in Idaho (I live in Italy) any hint?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have a pretty good understanding of C++. I have had three classes and written quite a bit of code. I just wish there was a book that broke it down easier than what I have.
As far as Idaho goes, you dont want to spend a Christmas here, its about 15 degrees out and I am looking at a few feet of snow. This is just a great enviroment for school cause there is nothing to do. I am from Tampa Bay, Florida. Couldn't get much done there
in the battle between a rock and a stream, the stream will always prevail, not through strength but through persistance
|
|
|
|
|
irs97 wrote: I have a pretty good understanding of C++.
Lucky guy! Then you have a good knowledge of templates and STL cannot be so hard to understand...
irs97 wrote: I have had three classes
Lucky guy again! Usually one have to code several hundreds before being comfortable with.
To understand STL have a look to MSDN library, there are a lot of good examples.
irs97 wrote: As far as Idaho goes, you dont want to spend a Christmas here, its about 15 degrees out and I am looking at a few feet of snow. This is just a great enviroment for school cause there is nothing to do. I am from Tampa Bay, Florida. Couldn't get much done there
I'm sorry about that. I wish you a merry Christmas and hope you'll be back in Tampa asap.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Well my your last reply, I can tell that I dont have enough experience. In my data structures class we simply briezed over templates. He told us that stl created templated and we really didnt need to know much about them. Maybe I do need to get some more experience. I was under the assumption that STL was suppose to make things easier. I guess I could be wrong. I thought lists, maps, ques, deques, vectors, linked lists, trees, were already created for you to use. No I am not that lucky my friend, I am just a beginner, by no means and I am great, I am just learning and searching for all the knowledge I can find.
IRS
In the battle between a rock and a stream, the stream will always prevail, not through strength but through persistance
|
|
|
|
|
First, I must apologize to you for my rudeness...
irs97 wrote: I was under the assumption that STL was suppose to make things easier.
This is true but you must know a bit of templates.
irs97 wrote: I thought lists, maps, ques, deques, vectors, linked lists, trees, were already created for you to use.
This is also true, but again, you must know a bit of templates.
Have a look to examples. STL documentation is quite too formal, while examples help you in practice.
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I don't have any book reccos but you could check out the STL section[^] here on CP.
|
|
|
|
|
*grin* That's just what I said.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi friends. I'm a new programmer. In an application, when i click About menu, i want the my About.h dialof form to display. In the MSND library, i saw such an example to display user defined dialogs;
{
Form ^ f = gcnew Form();
f->ShowDialog();
}
And i changed this code to display my About.h form dialog such as;
{
Form ^ About = gcnew Form();
About->ShowDialog();
}
But, i still see the same empty dialog instead of my About.h form. So how can i display this dialog when i click About menu ?
|
|
|
|
|
|
hope this helps, there, you're not creating an "about form", you're creating an empty form that is named "About". if you want to create an about form you'll probably need something like this:
<prv>
CAboutForm^ About=gcnew CAboutForm();
About->ShowDialog();
hope this helps
|
|
|
|
|
I want to extract the domain name from a url string. I know there is a function in wininet.dll InternetCrackUrl but I really don't want to link against the whole library to use just a single function. I tried passing the url into splitpath but it can't handle it ( the domain name is return as part of the path ).
Does anybody know of any other functions which may do the job?
|
|
|
|
|
Do you want the functionality of flags ICU_ESCAPE or ICU_DECODE?
Jeff
|
|
|
|
|
not really, I just want to extract the "www.google.com" from "http://www.google.com/search?url+split". For now at least, maybe later I will want to add more functionality.
|
|
|
|
|
It doesn't matter, I threw together a small function to do the job. It'll do for now at least.
bool SplitUrl( LPCSTR szUrl, LPSTR szLoc, UINT uLocSize )
{
UINT uCount = 0;
while ( *szUrl != '/' ){
if ( !*(szUrl) )
return false;
szUrl++;
}
if ( *(++szUrl) != '/' )
return false;
szUrl++;
while ( *szUrl != '/' && uCount < uLocSize-1 ){
if ( !*(szUrl) )
return false;
szLoc[uCount] = *szUrl;
szUrl++;
uCount++;
}
szLoc[uCount] = 0;
return uCount > 0;
}
|
|
|
|
|
You can always use dynamic loading thru LoadLibrary + GetProcAddress to resolve the function at runtime when you need to use it (perhaps to isolate all in a small class to cache this would be even better).
|
|
|
|