# How to share one proxy across multiple identical WaveAudioClip

**URL:** <https://forum.juce.com/t/how-to-share-one-proxy-across-multiple-identical-waveaudioclip/49641>\
**Category:** Tracktion Engine\
**Created:** [January 12, 2022, 11:42pm UTC](https://forum.juce.com/t/how-to-share-one-proxy-across-multiple-identical-waveaudioclip/49641 "2022-01-12T23:42:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![splintersilk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/splintersilk/32/14724_2.png) [@splintersilk](https://forum.juce.com/u/splintersilk)\
**Post date:** [January 12, 2022, 11:42pm UTC](https://forum.juce.com/t/how-to-share-one-proxy-across-multiple-identical-waveaudioclip/49641/1 "2022-01-12T23:42:14Z")

</div>

Hey there

I’m trying to figure out the best approach to share time-stretched proxies.

Multiple identical WaveAudioClips across a timeline. If I time stretch them all identically, a proxy generation job will start for each clip even though the results will also be identical.

What’s a good way to handle this?

I was thinking of using wavClip-\>getPlaybackFile().getFile() from the first generated proxy, and somehow setting this file to each of the identical wavClips, but it’s not obvious to me how to do that.

A stupid way I contemplated is to delete all the identical clips having stored their start/end points, except one. Then generate one proxy. And finally recreate copies of this new proxied-up clip to where the old clips used to be. This seems kind of insane though.

Any thoughts please?

Many thanks and best wishes

Jeff

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [January 13, 2022, 3:50pm UTC](https://forum.juce.com/t/how-to-share-one-proxy-across-multiple-identical-waveaudioclip/49641/2 "2022-01-13T15:50:01Z")

</div>

To be honest I just wouldn’t worry about this.  
It done the way it is because there are so many things that can affect a time-stretched proxy (clip length/offset, file start/end, loop start/end/offset, time sig, tempo change, key sig, time stretch algorithm, clip loop info etc). You’d have to make sure that all of these are identical to avoid accidentally using the same proxy for files that needed separate ones.

The _correct_ way to do it would be to ensure the proxy hash is comprised of only data that can affect the proxy contents. That would require hashing the tempo/pitch/key changes for the edit range the clip takes. That way, the same proxy could be used for multiple clips.

But honestly, it would be easier to just not worry about it.  
Hopefully this year we’ll add a mode to avoid creating creating proxies and do everything at process-time. That obviously trades off CPU use against pre-rendering time and disk space.

---

<div class="post-metadata">

**Author:** ![splintersilk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/splintersilk/32/14724_2.png) [@splintersilk](https://forum.juce.com/u/splintersilk)\
**Post date:** [January 16, 2022, 6:28am UTC](https://forum.juce.com/t/how-to-share-one-proxy-across-multiple-identical-waveaudioclip/49641/3 "2022-01-16T06:28:45Z")

</div>

Hey @dave96 thanks for the reply. That sounds very promising re: what might be coming later this year. And yes I take your point about things needing to be identical for the proxy sharing to work. The hash idea is neat. In my rather simplified use case I can make some pretty crude assumptions so I’m risking it for now and it seems to be working fairly nicely - for now.
