Hi,
I’ve written a plug-in which incorporates a simple echo-canceller (written to disclose the impuls response and the transfer function of some device connected to the sound-card - or simply to see the impulse reponse of the sound-card itself).
I’ve have made a button which when pressed should store the coefficients of the adaptive filter - this works but it takes approx. 30 seconds for the 512 coefficients to be stored in the file which corresponds to 18kb of data. The code used to store the data follows:
[code] if(button==saveButtonSoundCard)
{
currentFileSoundCard = T(“C:\AdapCoefsSoundCard.txt”);
if(currentFileSoundCard.existsAsFile())
currentFileSoundCard.deleteFile ();
else {
double* pointerCoefs = gl->canvas->pAdapCoefs;
for(int i=0; i<(gl->canvas->adapOrder) ; i++)
currentFileSoundCard.appendText(String(*pointerCoefs++) + T(" \n"),false);
}
}
if(button==saveButtonTelephone)
{
currentFileTelephone = T("C:\\AdapCoefsTelephone.txt");
if(currentFileTelephone.existsAsFile())
currentFileTelephone.deleteFile ();
else {
double* pointerCoefs = gl->canvas->pAdapCoefs;
for(int i=0; i<(gl->canvas->adapOrder) ; i++)
currentFileTelephone.appendText(String(*pointerCoefs++) + T(" \n"),false);
}
} [/code]
Can someone please tell me how the data can be stored faster?
Cheers