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

Playing two files in sync #1230

Closed
mainrs opened this issue May 16, 2024 · 1 comment
Closed

Playing two files in sync #1230

mainrs opened this issue May 16, 2024 · 1 comment
Labels

Comments

@mainrs
Copy link

mainrs commented May 16, 2024

I have two audio tracks. The first track contains the vocals of a song. The second the instruments.

I want to play them in sync. For that I create two instances of AudioMediaComponent and prepare the files.

I then call play on both of them. However, this does introduce sometines a noticable delay. Sometimes it doesn't.

What can be the cause for that? My guess would be that it puts the playback onto another thread, one for each component. And this it can introduce small delays when calling the play method (since one is called before the other).

@caprica
Copy link
Owner

caprica commented May 16, 2024

You can't synchronise like that reliably, there's nothing in VLC to keep them in sync either. What you said is almost certainly right, I mean the reasons for the drift.

However, what you can try is adding a new "slave" track, although I don't think you can play two audio tracks at the same time. Might be worth a quick try though.

I do seem to remember there was some kind of support for multi-track audio in the LibVLC API, but I never got it working. I can't remember how hard I tried tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants