Wave vizualization and recordind

Chaser_DS Messages postés 6 Date d'inscription mardi 11 avril 2006 Statut Membre Dernière intervention 3 juin 2008 - 5 déc. 2007 à 16:07
Chaser_DS Messages postés 6 Date d'inscription mardi 11 avril 2006 Statut Membre Dernière intervention 3 juin 2008 - 6 déc. 2007 à 19:32
Hi.

I am from Russia, and I small speak English.
I have a question.

Sample - It is a test audio visualization and audio recording test (link on source code I put below).
I am take a samples for recording audio from internet.
And I take a other source for audio visualization.
The imaging audio occurs on event "OnWaveIn".

My trouble:
On ditto event occurs and record audio.
So here is: if press on button "Record", that occur the error ("Access violation at address ..."), but if comment part of code:

{
WaveInAddBuffer(WaveIn, PWaveHdr(Msg.lParam),SizeOf(TWaveHdr));
data16:=PData16(PWaveHdr(Msg.lParam)^.lpData);

move(data16^[0],m,BufSize*2);
// if data16^[0]<>m[1]
// then showMessage('skipped');
}

that record goes orderly, but not vizualize wave audio.
If you are know to possible my problem, please ask me about solve trouble with combine the visual image audio and simultaneous its record.

Link to sample of source code: http://chaser.front.ru/WaveVizRecorder.zip

Thanks for your help!
Mersi )

3 réponses

Guillemouze Messages postés 991 Date d'inscription samedi 25 octobre 2003 Statut Membre Dernière intervention 29 août 2013 6
5 déc. 2007 à 17:07
 
WhiteHippo Messages postés 1154 Date d'inscription samedi 14 août 2004 Statut Membre Dernière intervention 5 avril 2012 3
5 déc. 2007 à 23:35
Hi

This is a french forum !  I'll answer you in english but it's the last time !!
The problem seems to be on your "move(data16^[0],m,BufSize*2);"
You have to take care of the length of the datas received, something like that :
    move(data16^[0],m,PWaveHdr(Msg.lParam)^.dwBufferLength);

P.S. No time to go deeper in your code to see if something else is wrong.

Cordialement.
<hr />"L'imagination est plus importante que le savoir." Albert Einstein
Chaser_DS Messages postés 6 Date d'inscription mardi 11 avril 2006 Statut Membre Dernière intervention 3 juin 2008
6 déc. 2007 à 19:32
Thanks WhiteHippo for help!
But with this correction "move(data16^[0],m,PWaveHdr(Msg.lParam)^.dwBufferLength)" the error does not appear, but recorded wav file is play as cheep, rather then as sounds when recording.
Can help someone else with this trouble?
Rejoignez-nous