# Add audio file player node for plugin host example

**URL:** <https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125>\
**Category:** General JUCE discussion\
**Created:** [April 7, 2016, 10:32pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125 "2016-04-07T22:32:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [April 7, 2016, 10:32pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/1 "2016-04-07T22:32:12Z")

</div>

It would be quite useful to have an internal audio file player filter in the plugin host example. There probably are 3rd party plugins that just play a file, but it’s an additional hassle to find one that would also be cross platform. It also isn’t as convenient as could be desired to use a sampler plugin instrument for this.

I just worked a couple of hours myself to add such an internal filter for the plugin host and it wasn’t too bad. I am sure the Juce developers could add a better one in a fraction of that time… 😉

---

<div class="post-metadata">

**Author:** ![jonathonracz](https://avatars.discourse-cdn.com/v4/letter/j/da6949/32.png) [@jonathonracz](https://forum.juce.com/u/jonathonracz)\
**Post date:** [April 8, 2016, 4:18am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/2 "2016-04-08T04:18:49Z")

</div>

Totally agree on this. My current solution is a cobbled together straightforward port of the audio file player from the JUCE demo into a plugin. This would be an awesome official utility plugin + example project for the JUCE team to make!

---

<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:** [April 8, 2016, 8:50am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/3 "2016-04-08T08:50:06Z")

</div>

Agreed! If only there were more hours in the day!

---

<div class="post-metadata">

**Author:** ![harryg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/harryg/32/7_2.png) [@harryg](https://forum.juce.com/u/harryg)\
**Post date:** [April 8, 2016, 9:01am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/4 "2016-04-08T09:01:43Z")

</div>

I have just implemented this and also a recorder.  
Once it is stable and the code is clean enough, I could contribute it.

---

<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:** [April 8, 2016, 9:09am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/5 "2016-04-08T09:09:00Z")

</div>

That’d be awesome 🙂

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [April 8, 2016, 2:29pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/6 "2016-04-08T14:29:40Z")

</div>

Nice to know there is interest to have this added! 🙂

I could also show my code, but it doesn’t do anything special at the moment. It doesn’t currently resample files that are at a different samplerate than the host is running at, and there’s no IO thread used for the file reading. Naughty me. But SSD drives seem to handle the playback fine anyway… 😓 Also the GUI is just a FileNameComponent at the moment.

---

<div class="post-metadata">

**Author:** ![zax](https://avatars.discourse-cdn.com/v4/letter/z/3e96dc/32.png) [@zax](https://forum.juce.com/u/zax)\
**Post date:** [June 30, 2016, 9:54am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/7 "2016-06-30T09:54:24Z")

</div>

I was just trying to do the same. I got curious about JUCE just recently and I’ve been fooling around with it for two weeks for now as a side project, but it is a bit hard to grasp how to combine these two examples, so I’d very much appreciate any code that I could have a look at how to implement such a feature.

If you aren’t too shy about sharing your code, no matter how crude, it would really give me a good kickstart here!

---

<div class="post-metadata">

**Author:** ![quematik](https://avatars.discourse-cdn.com/v4/letter/q/3ec8ea/32.png) [@quematik](https://forum.juce.com/u/quematik)\
**Post date:** [July 5, 2016, 8:04am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/8 "2016-07-05T08:04:27Z")

</div>

I would also appreciate a working example of this one! Thanks for any possible help

---

<div class="post-metadata">

**Author:** ![harryg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/harryg/32/7_2.png) [@harryg](https://forum.juce.com/u/harryg)\
**Post date:** [September 13, 2016, 9:18am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/9 "2016-09-13T09:18:32Z")

</div>

@zax and @quematik:  
Sorry, I missed your questions. Would the example still be helpful for you?  
It still isn’t nice cleaned up code, but working…

---

<div class="post-metadata">

**Author:** ![quematik](https://avatars.discourse-cdn.com/v4/letter/q/3ec8ea/32.png) [@quematik](https://forum.juce.com/u/quematik)\
**Post date:** [September 13, 2016, 10:16am UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/10 "2016-09-13T10:16:55Z")

</div>

yes, it would be, @harryg

---

<div class="post-metadata">

**Author:** ![harryg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/harryg/32/7_2.png) [@harryg](https://forum.juce.com/u/harryg)\
**Post date:** [September 13, 2016, 6:23pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/11 "2016-09-13T18:23:39Z")

</div>

OK, here we go:  
[example branch pluginhost-with-audioplayer](https://github.com/harry-g/JUCE/tree/pluginhost-with-audioplayer/examples/audio%20plugin%20host)  
I invested some time to provide a clean example, but it might not be perfect 😉  
Also documentation is poor…

My example’s current status is more sophisticated, but partially in experimental or ugly state.  
I can publish it as soon as it is cleaner.  
Additionally, it will only fully work with the [revised multibus API](https://forum.juce.com/t/revised-multibus-api-experimental-please-test/18491).  
It will be including a multifile player with audio thumbnails and a recorder.

---

<div class="post-metadata">

**Author:** ![quematik](https://avatars.discourse-cdn.com/v4/letter/q/3ec8ea/32.png) [@quematik](https://forum.juce.com/u/quematik)\
**Post date:** [September 22, 2016, 6:05pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/12 "2016-09-22T18:05:11Z")

</div>

@harryg thanks a lot for this, mate!

---

<div class="post-metadata">

**Author:** ![zax](https://avatars.discourse-cdn.com/v4/letter/z/3e96dc/32.png) [@zax](https://forum.juce.com/u/zax)\
**Post date:** [October 13, 2016, 1:47pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/13 "2016-10-13T13:47:52Z")

</div>

@harryg

I actually managed to produce my own, but it’ll be interesting to see how the differ 🙂

Anyhow, thanks for the reply!

---

<div class="post-metadata">

**Author:** ![harryg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/harryg/32/7_2.png) [@harryg](https://forum.juce.com/u/harryg)\
**Post date:** [January 26, 2017, 3:28pm UTC](https://forum.juce.com/t/add-audio-file-player-node-for-plugin-host-example/17125/14 "2017-01-26T15:28:59Z")

</div>

Hi, I finally my multi file audio player and recorder is in a clean state and published.  
See new thread: [https://forum.juce.com/t/audio-plugin-host-with-multi-file-audio-player-and-recorder](https://forum.juce.com/t/audio-plugin-host-with-multi-file-audio-player-and-recorder)
