# Float, double or template?

**URL:** <https://forum.juce.com/t/float-double-or-template/16093>\
**Category:** Audio Plugins\
**Created:** [November 28, 2015, 8:30pm UTC](https://forum.juce.com/t/float-double-or-template/16093 "2015-11-28T20:30:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [November 28, 2015, 8:30pm UTC](https://forum.juce.com/t/float-double-or-template/16093/1 "2015-11-28T20:30:32Z")

</div>

I'm kinda new to developing audio plugins, so I was wondering what the best way to deal with the processBlock function is concerning floats or doubles. I've seen some code written with templates, but I don't understand what the compatibility issues are. If I'm developing an audio plugin that I want to work in the most formats, should I write it with floats, doubles or both (templates) in mind? I'm asking about the AudioSampleBuffer perspective.

Thanks.&nbsp;

&nbsp;

&nbsp;

---

<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:** [November 29, 2015, 10:16am UTC](https://forum.juce.com/t/float-double-or-template/16093/2 "2015-11-29T10:16:21Z")

</div>

Depends on whether your plugin would ever need to produce 64-bit output, and in&nbsp;most cases the answer is "no", because it rarely makes any noticeable&nbsp;difference to the sound, while using more CPU.

You might want to keep your options open and write it with templates, which will complicate things a bit. But if you don't think any of your users&nbsp;would ever care about 64-bit then the easiest way to do it would be to just use plain old floats.

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [November 29, 2015, 5:10pm UTC](https://forum.juce.com/t/float-double-or-template/16093/3 "2015-11-29T17:10:53Z")

</div>

So whether a plugin is 32 bit or 64 bit has nothing to do with the actual data buffer size, only the memory addressing?

&nbsp;

&nbsp;

---

<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:** [November 30, 2015, 11:53am UTC](https://forum.juce.com/t/float-double-or-template/16093/4 "2015-11-30T11:53:21Z")

</div>

The confusion is understandable, but there are&nbsp;two entirely separate and unrelated things:

- Whether you're building a binary for 32 or&nbsp;64-bit CPU architecture.

- Whether your plugin can accept 32-bit (float)&nbsp;and/or 64-bit (double) audio buffers.
