# AudioPlayHead simple example needed for noob

**URL:** <https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268>\
**Category:** Audio Plugins\
**Created:** [September 17, 2019, 12:29pm UTC](https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268 "2019-09-17T12:29:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![2dave](https://avatars.discourse-cdn.com/v4/letter/2/cc9497/32.png) [@2dave](https://forum.juce.com/u/2dave)\
**Post date:** [September 17, 2019, 12:29pm UTC](https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268/1 "2019-09-17T12:29:29Z")

</div>

Hi,  
I’m very new to c++ and JUCE and was hoping someone could provide a very simple code example of the AudioPlayHead.  
I just want to see IS PLAYING, IS RECORDING and IS STOPPED accordingly in a simple VST plugin so I can figure out where I went wrong.  
I’d appreciate any help on this.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [September 17, 2019, 1:38pm UTC](https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268/2 "2019-09-17T13:38:15Z")

</div>

hi.  
You can have a look to the AudioPluginDemo :

> <https://github.com/WeAreROLI/JUCE/blob/develop/examples/Plugins/AudioPluginDemo.h#L607>

---

<div class="post-metadata">

**Author:** ![2dave](https://avatars.discourse-cdn.com/v4/letter/2/cc9497/32.png) [@2dave](https://forum.juce.com/u/2dave)\
**Post date:** [September 17, 2019, 2:21pm UTC](https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268/3 "2019-09-17T14:21:51Z")

</div>

Thanks for that. I had looked at this and the InterApp demo which has the same thing. I was hoping there was an option that was a little less codey so I could narrow in on what I’m missing without all the extra stuff those demos have.  
Thanks, I will persevere. I’ll get there in the end.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [September 17, 2019, 2:37pm UTC](https://forum.juce.com/t/audioplayhead-simple-example-needed-for-noob/35268/4 "2019-09-17T14:37:03Z")

</div>

It is literally just copying the contents of the function @lalala linked into your processBlock() method. Only during processing this data is available.

The information is in the struct, in the example called [newTime](https://docs.juce.com/develop/structAudioPlayHead_1_1CurrentPositionInfo.html):

```auto
if (newTime.isRecording == true)
    foo();

```

but be aware, not all hosts provide that information…
