Jump to content


How to return Ogg Vorbis file pointer to start?


4 replies to this topic

#1 MarekKnows.com

    Valued Member

  • Members
  • PipPipPip
  • 190 posts
  • LocationOntario, Canada

Posted 29 March 2009 - 07:27 PM

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?
C++, 3D OpenGL and Game Programming video tutorials:
www.MarekKnows.com
Play my free games: Ghost Toast, Zing

#2 martinsm

    Member

  • Members
  • PipPip
  • 88 posts

Posted 29 March 2009 - 07:47 PM

Read The Fine Manual :)
http://www.xiph.org/.../reference.html

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

#3 MarekKnows.com

    Valued Member

  • Members
  • PipPipPip
  • 190 posts
  • LocationOntario, Canada

Posted 29 March 2009 - 07:49 PM

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?
C++, 3D OpenGL and Game Programming video tutorials:
www.MarekKnows.com
Play my free games: Ghost Toast, Zing

#4 TheNut

    Senior Member

  • Moderators
  • 1719 posts
  • LocationCyberspace

Posted 30 March 2009 - 12:00 AM

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.
http://www.nutty.ca - Being a nut has its advantages.

#5 MarekKnows.com

    Valued Member

  • Members
  • PipPipPip
  • 190 posts
  • LocationOntario, Canada

Posted 30 March 2009 - 12:56 AM

That did the trick. Thanks TheNut.

If you'd like to try out my game, you can download it here:
http://www.marek-kno...topic.php?t=356
C++, 3D OpenGL and Game Programming video tutorials:
www.MarekKnows.com
Play my free games: Ghost Toast, Zing





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users