# How to change position (time) in programmer sounds?

**URL:** <https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716>\
**Category:** FMOD Engine\
**Created:** [February 3, 2021, 9:40am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716 "2021-02-03T09:40:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgalach](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mgalach](https://qa.fmod.com/u/mgalach)\
**Post date:** [February 3, 2021, 9:40am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/1 "2021-02-03T09:40:54Z")

</div>

I have non-looped long sound. It is for cutscene player, so I want sometimes play from specific time. When I use instance-\>setTimelinePosition it will always succeed, but sometimes in a moment I’m getting callback to create programmer sound again. So I’ve tried to set initialseekposition when creating sound in callback, sometimes I get “Loading delay exceeded, sound may play at incorrect time” and sound plays from the beginning.  
Also instance-\>getTimelinePosition sometimes returns time greater than actual sound length.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [February 8, 2021, 2:48am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/2 "2021-02-08T02:48:14Z")

</div>

What version of FMOD are you using?  
Are you able to share your callback code at all?

---

<div class="post-metadata">

**Author:** ![mgalach](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mgalach](https://qa.fmod.com/u/mgalach)\
**Post date:** [February 9, 2021, 12:18pm UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/3 "2021-02-09T12:18:47Z")

</div>

2.0.14

Callback is basically the same as UFMODAudioComponent::EventCallbackCreateProgrammerSound.  
I’ve only tried to add just before creating sound:  
SoundInfo.exinfo.initialseekpostype = FMOD\_TIMEUNIT\_MS;  
SoundInfo.exinfo.initialseekposition = RequestedTime;  
but sound always play from start

When I use StudioInstance-\>setTimelinePosition, it will usually restart programmer sound. But sometimes it doesn’t, but still it will not work (but now getTimelinePosition will now report different position like it was changed correctly - thats why can report time longer than actual sound).

When I’ve removed NON\_BLOCKING, I’m no longer getting warnings about “sound may play at incorrect time”.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [February 11, 2021, 12:16am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/4 "2021-02-11T00:16:16Z")

</div>

The “sound may play at incorrect time” warning should be able to be removed by preloading the sounds before the event needs to play them. We are looking into possible ways we can improve this experience.

`exinfo.initialseekposition` only works for streams and only the first time the stream is played.

`setTimelinePosition` does not currently work with programmer sounds, even if the instrument is synchronous, which is something that requires investigation because you would expect it to. I have created a task to investigate a fix for an upcoming release.

---

<div class="post-metadata">

**Author:** ![mgalach](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mgalach](https://qa.fmod.com/u/mgalach)\
**Post date:** [February 11, 2021, 7:43am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/5 "2021-02-11T07:43:36Z")

</div>

Thanks for looking into this!

---

<div class="post-metadata">

**Author:** ![Bnnoy](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@Bnnoy](https://qa.fmod.com/u/Bnnoy)\
**Post date:** [August 5, 2022, 1:29pm UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/6 "2022-08-05T13:29:42Z")

</div>

Hello!

I’m quite interested in this issue given that I need to play/pause/seek in a programmer sound. This message being more than a year old, has the setTimelinePosition issue with programmer sounds have been fixed?

If not, I had a working implementation using directly the Core API (through FMOD::Sound and FMOD::Channel), but I wanted to have better control over the global sound mix and started using Studio API instead. Can I mix Studio and Core APIs, using the Studio API to create the programmer sound event that’s correctly routed and mixed via Studio, and then manipulate the FMOD::Sound for pause/seek?

---

<div class="post-metadata">

**Author:** ![Bnnoy](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@Bnnoy](https://qa.fmod.com/u/Bnnoy)\
**Post date:** [August 5, 2022, 2:40pm UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/7 "2022-08-05T14:40:04Z")

</div>

Additional question: if I’m supposed to use FMOD::Channel API for playback control, how can I get the proper Channel to use ?

I have a bus setup in FMOD studio called “Track”. I tried to call `getBus("bus:/Track", &myBus)` and then `trackBus->GetChannelGroup(&myChannelGroup)` but:

- calling it before I start playing the Event fails (which is normal from what I understand, as it’s the only Event on the bus and channels are created only when needed)
- calling it in the Event callback when the programmer sound is created works, but checking `myChannelGroup->getName()` returns “Master”, which is odd, and also I don’t know how to get the proper Channel from the ChannelGroup
- using `EventInstance->getChannelGroup()` from the callback also works, but the ChannelGroup name is also “Master” (and same question about how to get the Channel from the group)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [August 10, 2022, 6:05am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/8 "2022-08-10T06:05:59Z")

</div>

> [@Bnnoy](#):
>
> Can I mix Studio and Core APIs

The less you can do this the better, as reaching into the Core API through the Studio API and modifying things can cause unintended issues if you are not careful, although there are some occasions when you just don’t have a choice.

> [@Bnnoy](#):
>
> I need to play/pause/seek in a programmer sound

`setTimelinePosition` still doesn’t work with programmer instruments. A workaround for this could be to automate the start offset of the programmer instrument with a parameter.  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/477be8725105822003eeb25fbea5dd838552ae8d.png)

Although this only works before the programmer sound is played.

> [@Bnnoy](#):
>
> `myChannelGroup->getName()` returns “Master”

The name ‘Master’ in this context is the Master track of an event in FMOD Studio:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/3ae776e0f02d30b8f4bf2b2c03d368a3dcd40b98.png)

---

<div class="post-metadata">

**Author:** ![osmoticstudios](https://avatars.discourse-cdn.com/v4/letter/o/e0b2c6/32.png) [@osmoticstudios](https://qa.fmod.com/u/osmoticstudios)\
**Post date:** [July 6, 2023, 4:13pm UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/9 "2023-07-06T16:13:54Z")

</div>

> [@cameron-fmod](#):
>
> `setTimelinePosition` does not currently work with programmer sounds, even if the instrument is synchronous, which is something that requires investigation because you would expect it to. I have created a task to investigate a fix for an upcoming release.

@cameron-fmod Hi, is there a fix for this already? Cheers!

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [July 17, 2023, 4:02am UTC](https://qa.fmod.com/t/how-to-change-position-time-in-programmer-sounds/16716/10 "2023-07-17T04:02:42Z")

</div>

There are no plans to make `setTimelinePosition` work with async instruments, since they are are not time-locked they are not effected by the timeline position, but synchronous programmer instruments should be working with it.
