Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PsyDuration is not accurate enough to represent the duration of the frame rate of audio #68

Open
maartenuni opened this issue Jan 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@maartenuni
Copy link
Contributor

maartenuni commented Jan 15, 2024

From the audio device, one can get a PsyDuration* that represents the frame dur.

E.g. The frame_dur of an PsyAudioDevice Sampling at 44100 Hz is 23µs according to the duration it is rounded to the nearest µs whereas it is 22.68... µs in reality.
So if you calculate the number of frames it takes to generate a PsyWave of 250 ms it is 10870, however 10870 * 1/44100 ~ 246 ms, hence the stimulus loses 4 ms. As aiming for ms precision, this isn't good enough, So we should try to improve the precision to calculate the number of frames that makes up 250ms.

@maartenuni maartenuni added bug Something isn't working enhancement New feature or request labels Jan 15, 2024
@maartenuni maartenuni self-assigned this Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant