How to return Ogg Vorbis file pointer to start?

500367065665a05a847242a39a0bc69e
0
mmakrzem 101 Mar 29, 2009 at 19:27

I want to return my file pointer for my Ogg Vorbis file back to the start so that when I call ov_read it will return to me the beginning of the sound file.

How can I control the location of the file pointer?

4 Replies

Please log in or register to post a reply.

8fd4a055522ce713cde7dd1cb4083cb2
0
martinsm 101 Mar 29, 2009 at 19:47

Read The Fine Manual :)

http://www.xiph.org/vorbis/doc/vorbisfile/reference.html

Functions you seek is under Seeking section - ov_XXX_seek().

500367065665a05a847242a39a0bc69e
0
mmakrzem 101 Mar 29, 2009 at 19:49

my Ogg file is not seekable therefore I cannot use the seek functions.

Is there another way that I can “rewind” my file back to the start?

6837d514b487de395be51432d9cdd078
0
TheNut 179 Mar 30, 2009 at 00:00

Only thing I could think of is closing and reopening it. Ogg has some internal states and if you mess with the file pointer you will likely break something. Being open source of course, you could go in their code and iron out a solution that would be faster.

500367065665a05a847242a39a0bc69e
0
mmakrzem 101 Mar 30, 2009 at 00:56

That did the trick. Thanks TheNut.

If you’d like to try out my game, you can download it here:

http://www.marek-knows.com/phpBB2/viewtopic.php?t=356