Seeking in arsd.simpleaudio?

TheZipCreator thezipcreator at protonmail.com
Sun Nov 20 20:23:28 UTC 2022


I'm currently making a library to do programmatic animation (akin 
to [manim](https://www.manim.community/) but for D and a 
different style) and for audio arsd.simpleaudio seems like the 
only real option (all the others I could find are too low-level 
for my taste) but if I want to skip to a specific section of the 
video, then I'd need to be able to seek the audio to that 
location too, and it appears that arsd.simpleaudio doesn't have a 
seek function. Is there a way to do this via other means? I want 
something like:

```d

import arsd.simpleaudio, arsd.vorbis;

void main() {
   AudioOutputThread aot = AudioOutputThread(true);
   aot.playOgg("myAudio.ogg");
   import std.datetime;
   aot.seek(5.seconds); // or maybe this could be directly in 
.playOgg
}
```

so how would you implement this hypothetical `seek` function? (or 
if you could tell me a different library that already has this 
functionality that'd be great too)


More information about the Digitalmars-d-learn mailing list