thanks for your attention.
I am going to embed an audio file to pptx file and then
set “Start Automatically” and “Hide During Show” option with python code, which is in Power Point Audio Option Setting.
But I have no way.
I used “python-pptx”.
This is code snippet for the logic.
<code>prs = Presentation(pptx_path)
while len(prs.slides) <= slide_index:
prs.slides.add_slide(prs.slide_layouts[5])
slide = prs.slides[slide_index]
left = top = Inches(1) width = height = Inches(1)
audio_shape = slide.shapes.add_movie(
audio_path,
left, top, width, height,
mime_type='audio/mpeg', poster_frame_image=None
)
</code>
<code>prs = Presentation(pptx_path)
while len(prs.slides) <= slide_index:
prs.slides.add_slide(prs.slide_layouts[5])
slide = prs.slides[slide_index]
left = top = Inches(1) width = height = Inches(1)
audio_shape = slide.shapes.add_movie(
audio_path,
left, top, width, height,
mime_type='audio/mpeg', poster_frame_image=None
)
</code>
prs = Presentation(pptx_path)
while len(prs.slides) <= slide_index:
prs.slides.add_slide(prs.slide_layouts[5])
slide = prs.slides[slide_index]
left = top = Inches(1) width = height = Inches(1)
audio_shape = slide.shapes.add_movie(
audio_path,
left, top, width, height,
mime_type='audio/mpeg', poster_frame_image=None
)
Please let me know how to set the options with python.
Thanks.