views:

27

answers:

1

Hi,

I'm trying to synchronize 5 audio files (mp3) each representing a musical instruments. I'm using MediaElements.

I'm starting all the MediaElements at the same time and it works perfectly until I try to pause/play these audio files. When I start them after the pause, they become unsynchronized.

Using a timer, I tried to check when they become unsynchronized, and tried to synchronize them again by giving them the same position... but this didn't work.

Any idea on how to synchronize audio files perfectly.

Regards. Thanks for your help.

A: 

The closest you can get to syncing multiple media files is to use a custom MediaStreamSource. By making a media stream source, you feed to the MediaElement the samples and sample times. This allows for perfect control over synchronization. There is an example of MediaStreamSource and MP3 here. You will have to modify it to make it stay in sync.

Jeremiah Morrill
Thanks Morrill,unfortunately, event with the MediaStreamSource, I'm still getting unsynchronized playback of my audio files.Regards.
KRouane
You have to write your own code to sync them. MediaStreamSource just gives you access to the time codes.
Jeremiah Morrill