# Playing several audio sources synchronously

**URL:** <https://forum.juce.com/t/playing-several-audio-sources-synchronously/5689>\
**Category:** General JUCE discussion\
**Created:** [September 22, 2010, 6:28pm UTC](https://forum.juce.com/t/playing-several-audio-sources-synchronously/5689 "2010-09-22T18:28:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mowgly](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mowgly](https://forum.juce.com/u/mowgly)\
**Post date:** [September 22, 2010, 6:28pm UTC](https://forum.juce.com/t/playing-several-audio-sources-synchronously/5689/1 "2010-09-22T18:28:44Z")

</div>

Hello,

First of all I am new to JUCE so I do apologise if my question sounds dumb to some of you 😉 This is my first topic on that forum.

Here it is: I am trying to make a piece of code that will read several audio sources (coming from .wav files) simultaneously. I’ve manage to work out a solution with a MixerAudioSource that takes several AudioTransportSource that have been built with AudioFormatReaderSource objects that read my .wav files. But, correct me if I’m wrong, this solution is not good enough since I have to iterate through my AudioTransportSource objects, and call AudioTransportSource::start() one by one. Therefore, the samples playback will not start exactly at the same time (there will be a slight delay, the time between 2 calls to the play() method).

Is there any simple solution to my problem?

Thanks a lot!  
Nico

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 22, 2010, 7:50pm UTC](https://forum.juce.com/t/playing-several-audio-sources-synchronously/5689/2 "2010-09-22T19:50:05Z")

</div>

I think you should probably be mixing then and THEN putting them through a transport control!

---

<div class="post-metadata">

**Author:** ![mowgly](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mowgly](https://forum.juce.com/u/mowgly)\
**Post date:** [September 22, 2010, 9:36pm UTC](https://forum.juce.com/t/playing-several-audio-sources-synchronously/5689/3 "2010-09-22T21:36:21Z")

</div>

Well that sounds quite sensible indeed, thanks. I still have one question though: the AudioTransportSource takes into account only files inherited from PositionableAudioSource, which is not the case of the mixer… Should I create my own custom Mixer class, of is there an easier workaround?
