Handling m4b chapters using Python binding

This forum is about all development around libVLC.
peppy.player
Blank Cone
Blank Cone
Posts: 38
Joined: 10 Nov 2017 00:07

Handling m4b chapters using Python binding

Postby peppy.player » 17 Jun 2023 19:45

Hi,

Is it possible to list audiobook chapters and select a particular audiobook chapter using the Python binding?

Thank you!

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Handling m4b chapters using Python binding

Postby mfkl » 19 Jun 2023 06:40

https://mfkl.github.io

peppy.player
Blank Cone
Blank Cone
Posts: 38
Joined: 10 Nov 2017 00:07

Re: Handling m4b chapters using Python binding

Postby peppy.player » 20 Jun 2023 23:23

Thank you!
I was able to get chapetrs this way after starting the playback:

Code: Select all

self.player.play() chapters = [] try: descriptions = self.player.get_full_chapter_descriptions(0) for d in descriptions: chapters.append({ "name": d.name, "time_offset": d.time_offset, "duration": d.duration}) except Exception as e: print(e)
Switching chapters works as well:

Code: Select all

self.player.set_chapter(11)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests