Code: Select all
struct komorraVoice{
PVoiceParams params;
int pos;
int state;
int HostTag;
};
Code: Select all
int __stdcall TkomorraFLGen::TriggerVoice(PVoiceParams VoiceParams,int SetTag)
{
komorraVoice *Voice = new komorraVoice;
Voice->HostTag = SetTag;
Voice->params = VoiceParams;
Voice->state = 1;
return (TVoiceHandle)Voice;
}
Code: Select all
void __stdcall TkomorraFLGen::Voice_Release(TVoiceHandle Handle)
{
((komorraVoice*)Handle)->state = 0;
}
void __stdcall TkomorraFLGen::Voice_Kill(TVoiceHandle Handle)
{
delete (komorraVoice*)Handle;
}
Code: Select all
int __stdcall TkomorraFLGen::Voice_Render(TVoiceHandle Handle, PWAV32FS DestBuffer, int &Length)
{
komorraVoice *Voice = (komorraVoice*)Handle;
for(int la=0;la<Length;la++)
{
(*DestBuffer)[la][0]=(float)sin(la/3000.0f);
(*DestBuffer)[la][1]=(float)sin(la/3000.0f);
}
return 0;
}
The sound is more silent when I increase 3000.0f value in sin function.
What is here wrong?