azul3d / engine

Azul3D - A 3D game engine written in Go!
https://azul3d.org
Other
617 stars 52 forks source link

Implement seeking. #55

Open slimsag opened 8 years ago

slimsag commented 8 years ago

From @slimsag on September 25, 2014 23:19

The decoder should implement seeking (or perhaps not all decoders will be audio.ReadSeekers?).

Also see azul3d/audio#3

Copied from original issue: azul3d/audio-flac#2

slimsag commented 8 years ago

From @mewmew on September 17, 2015 11:37

@slimsag said:

I have actually wanted to ask @mewmew for his thoughts about the flac decoder and seeking. I know it's not implemented so I don't know if you've even thought about it -- but how hard do you think it would be to implement seeking (and potentially relative seeking like this) inside of a flac file? What problems do you think we would run into, if any?

Using flac.Stream.Next it should be possible to implement seek support without having to decode any audio samples, just the frame headers. I still have to think more about how it would work with relative vs. absolute seeking. Anyone interested in playing around with this, feel free to do so! I would be happy to support the explorative journey of anyone who wishes to get their hands dirty and fiddly around with implementing seek support. Obviously we still have to get the API just right, as mentioned in the azul3d/audio#3, but I think that an intuition may very well arise from this experimental implementation, which could answer questions like; does it make sense to use absolute seeking? What about relative? Or should both be provided. io.Seeker implements both, using os.SEEK_CUR for relative and os.SEEK_SET for absolute.

Get in touch with me, or anyone else involved in the Azul3d project if you feel like playing around with this! :) We would be happy to assist you in any way possible.

Cheers /u