Handling m4b chapters using Python binding
Posted: 17 Jun 2023 19:45
by peppy.player
Hi,
Is it possible to list audiobook chapters and select a particular audiobook chapter using the Python binding?
Thank you!
Re: Handling m4b chapters using Python binding
Posted: 19 Jun 2023 06:40
by mfkl
Re: Handling m4b chapters using Python binding
Posted: 20 Jun 2023 23:23
by peppy.player
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: