Controlling sound from code: start, stop, rewind, loop, set start position dynamically?

I’m taking a look at some explanations of sound in UDK, and I haven’t figured out a way to do this yet without digging into native code. Can I create a sound instance the way I might create a material instance, and then pass it parameters? I think I can figure everything out that I need except for telling the game where I want to start playing from. Does anyone (@gaz, you still around?) know how to do this?

You can stop the audio component by calling Stop() function. Pitch and volume can be controlled by script if you add continuous modulator node to sound cue. Regarding custom start position… I’m joining to your question here.

Start position would require a method similar to the “stingers” used in unreal tournament music, for example.

Alternatively maybe you could Start at the beginning followed by some playrate mod might be something to look in to.

Rachel released some game called REWIND, maybe one of her books has the answer. Think it Rachel (Angle Mapper)… or was it someone else lol?

  • I guess you need to get the real time of the track time somehow, UE4 has this i believe, UDK may have something you can do to make a FLOAT out of the current track time

Finally:

Maybe using the director track in Unreal matinee will be sufficient, it should be as powerful with audio/ sound as it is with anything else

https://docs.unrealengine.com/udk/Three/CreatingCinematics.html
https://docs.unrealengine.com/udk/Three/MatineeUserGuide.html

Thanks everyone for your responses. The more I work on this, the more I think it just can’t be done (or can’t be done without deep rewriting of UE3 or some really creative hack that hasn’t occurred to me yet) so I’m probably just going to have to shelve this. This actually isn’t essential for my current project, and I’ll just keep working at the critical stuff. When I start my next project in UE4, I’ll dig deeper into this, and hopefully it’ll be an easy solution. Thanks again. But if anyone does figure it out, it would still be good to know.

Well, it might be possible with dllbind. One of programmers in our team tried to write dll music manager and it could loop music tracks from a certain position. The thing is that you’ll have to store your sounds or music externally.