|
the "tick" (or click) which you hear at the beginning of your sound is absolutely normal. If you listen carefully, you will also hear a click at the end of your sound eg. when playing a noise. The reason is, that your loudspeaker membrane goes from zero deflection abruptly to a hughe deflection or the other way around at the end of your sound. If you change the sound it is the same. You change the deflection very abruptly. This will always cause a click.
To prevent this effect, one usually "ramp" the signal (kind of fading). A cosine square ramp at the beginning and at the end of your signal will prevent this click (rise ramp:-pi/2 to 0; decay ramp: 0 to pi/2). 5ms ramp duration each should be enough. You can also use a linear rise/decay ramp of this duration. It is not as good as the cosine sqaure ramp but maybe it is a little bit easier to program.
Good luck
|
|
|
|
|
Ok, for start and end I thinck no problem, I can make something...but if i would like to change the sound? How can I be sure that the new sound and the old are the same (maybe similar) to not produce this strange effect? Can I? Or It's impossible?
|
|
|
|
|
You use the DSBCAPS_CTRLVOLUME Flag for your sound buffer. Before you lock the buffer you could try to use SetVolume() in a loop to decrease the level of the sound which is currently playing, then copy your new sound to the buffer, unlock the buffer and use SetVolume() in a loop again to increase the level of your new sound. I haven't tried it before but it should work. If it works you could also use this for the beginning and the end of your wave files. Then you don't have to do the ramping on your own. You can let SetVolume() do the work for you.
|
|
|
|
|
Thank you very much for your help! But I thing thak the problem is another...When I create the sound I make it using the maximum of volume and I play it and, after, i set the volume. I would like set the volume during the play and the SetVolume() can only attenuate it...so...I create at the maximum value and the tick are when I call the Play() It' possible create a sound with a volume and after incrementate it?
|
|
|
|
|
One problem is that the CSound Class sets the Volume inside the play() member function. It is correct to generate the sound with the max volume (max dynamic range of bit resolution). You can send it to the buffer and play it but when you call the play() function you should set the volume to max attenuation. This will only change the attenuation on the buffer. If you set the volume to zero attenuation your sound is of maximal loudness again. After you have used play() in your code, you should immediately call SetVolume in a loop to decrease attenuation. This is not implemented in CSound. You should add a methode where you can independently set the Volume. Eg.:
void CSound::Attenuation(long lVolume)
{
pDSB->SetVolume( lVolume );
}
Then you can adjust Volume from your application.
CSound myCSound;
myCSound-play();
for(int i(-10000); i<0; ++i)
myCSound->Attenuation(i)
I think it should work
|
|
|
|
|
I've installed Visual C++ now I want to install and use Platform SDK WinXP SP2 but I cannot configure it. I've read the installation instructions on MS site.
With my VC I experience the known bug: no folder icons in the Project & Solutions option. I'm trying to add include and lib folders manually by editing the file VCProjectEngine.Dll.Express.Config but I cannot make it work. Well I have done the same for DirectX SDK and the compiler can find the directx include files but it cannot find Windows.h.
Any ideas whats wrong? Have you successfully set up the PSDK with VC2005?
|
|
|
|
|
I could be out on a limb here, but I think that with VC++ 2005 Express Edition, all that you can do is produce Managed C++ applications. Remember it's called Express edition for a reason. The use of the Platform SDK becomes irrelevant, in fact can not even be used.
But my intrepration may be wrong.
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
You can produce Win32 programs with Visual C++ 2005 Express by default you can do only console applications and you have to install Platform SDK for Windows.h and the other core platform stuff. There are instructions on MS site how to configure and install it.
The problem is that the beta is buggy and the installation is not straightforward.
|
|
|
|
|
I'm a MFC programmer, and I see many many applications are writen by MFC.
So, does windows form application has the same concept of MDI, SDI ?
After a few years, will most applications be based on windows form?
|
|
|
|
|
this is a .NET notion, but no one tell you this is the only way to program... MFC is FREE !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Currently, we are loading the VxD by explicitly specifying its name in a CreateFile call. What we want to do, is to have VCOMM load our VxD as a port driver, for some COM port. Any COM port will do.
we need to get VCOMM to load our VxD in response to the Open call made by an application on some COM port.
Tell me why
|
|
|
|
|
Could you tell me how can I get system menu by API ?
hmenu = GetSystemMenu(hWnd,1);
hmenu_options_thread1 = GetSubMenu(hmenu,1);
UINT uIDCheckItem;
uIDCheckItem = GetMenuItemID(hmenu_options_thread1,1);
smenu = new TCHAR[21];
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,20,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Menu",MB_OK);
Thank you.
|
|
|
|
|
Hi,
can I get help on how to block and realse the ports for Win 98 OS. From msdn i found that ipseccmd is the utility that could be used for Windows XP and Windows2000 to block/release ports. Similraly, is there any utility available for Windows 98? Or is there any other method by which I can block/relase ports for Windows 98(i.e, any registry enry that helps in blocking ports)???????
Thnx in advance
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
Just listen to that port and don't accept any connection, then it's "closed" .
The other way is to create a device driver.
Don't try it, just do it!
|
|
|
|
|
Hi,
I need to block both outbound and inbound ports.As you say I can listen in that port and not accept connections to control inbounf traffic on that port.But waht could be done for the outbound traffic?Could you explain more about the device drivers method which you have mentioned?
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
How to get the last write time of all files of a direcory of a ftp server in a single session.
|
|
|
|
|
Hi ,
Can any one tell me how to hide the charcters from being displayed on the screen. eg, if i want to key in the password i can see them in the clear text but i want to see them in ****** format. can any one provide me the source or tips to do this in C/C++.
Thank You.
Regards
sudha.
|
|
|
|
|
check ES_PASSWORD style
suhredayan There is no spoon.
|
|
|
|
|
int i=0;
cout<<"Enter the Password";
char strPassword[100];
strPassword[i++]=getche();
while(strPassword[i-1]!='\n')
{
cout<<"*";
strPassword[i++]=getch();
}
strPassword[i-1]!=NULL;
cout<<strPassword;
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
doe this work while pushing backspace ???
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
doe this work while pushing backspace ???
I believe Nope!, thats the logic only,Buddy!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
so be sure not to have too big fingers (to avoid typing wrong passwords - 2 letters in 1 press )...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
so be sure not to have too big fingers
:->
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thank You Very Much Sir.
I appreciate that.
|
|
|
|
|
aaah.....;)....i dunno if u have found out an answer.....if u havent ...try thiz out.....
#include<iostream.h>
#include<conio.h>
void main(void)
{
char passw[50];
char ch;
int i;
clrscr();
cout<<"Enter the password: \n";
i=0;
while( (ch=getch())!=13 )
{
if(ch==8)
{
if(i>0)
{
i-=1;
cout<<(char)ch;
cout<<" ";
cout<<(char)ch;
}
}
else
{
cout<<"*";
passw[i]=ch;
i+=1;
}
}
passw[i]=NULL;
cout<<"\n\n\n\n\n";
cout<<passw;
getch();
}
hope thiz helpz.....;)
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|