You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If real-time parsing LTC is implemented, I tried it. One frame will always be lost from transmission to parsing and printing, and there is a delay of about one second. This has troubled me for a long time and I don’t know how to solve it.
If real-time parsing LTC is implemented, I tried it. One frame will always be lost from transmission to parsing and printing, and there is a delay of about one second. This has troubled me for a long time and I don’t know how to solve it.
`
void Myltc(ltcsnd_sample_t* sound, int bufferSize) {
LTCDecoder* decoder = ltc_decoder_create(1920, 32);
LTCFrameExt frame;
ltcsnd_sample_t* soundCopy = (ltcsnd_sample_t*)malloc(bufferSize * sizeof(ltcsnd_sample_t));
if (soundCopy == NULL) {
fprintf(stderr, "Failed to allocate memory for sound copy.\n");
return;
}
memcpy(soundCopy, sound, bufferSize * sizeof(ltcsnd_sample_t));
ltc_decoder_write(decoder, soundCopy, bufferSize, 0);
while (ltc_decoder_read(decoder, &frame)) {
SMPTETimecode stime;
ltc_frame_to_time(&stime, &frame.ltc, 1);
printf("%02d:%02d:%02d%c%02d\n", stime.hours,
stime.mins, stime.secs, (frame.ltc.dfbit) ? '.' : ':',
stime.frame);
}
free(soundCopy);
ltc_decoder_free(decoder);
}
void CALLBACK waveInProc(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) {
if (uMsg == WIM_DATA) {
paData* data = (paData*)dwInstance;
WAVEHDR* waveHeader = (WAVEHDR*)dwParam1;
if (waveHeader->dwBytesRecorded > 0) {
Myltc((ltcsnd_sample_t*)waveHeader->lpData, waveHeader->dwBytesRecorded / sizeof(ltcsnd_sample_t));
}
waveInAddBuffer(hwi, waveHeader, sizeof(WAVEHDR));
}
}
DWORD WINAPI RecordingThread(LPVOID lpParameter) {
paData* data = (paData*)lpParameter;
HWAVEIN hWaveIn;
WAVEHDR waveHeader;
MMRESULT result;
WAVEFORMATEX waveFormat;
}
int main() {
paData data;
HANDLE hRecordingThread;
DWORD dwThreadId;
}`
The text was updated successfully, but these errors were encountered: