scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.37k stars 513 forks source link

Access sound programatically. #782

Open joereddington opened 2 years ago

joereddington commented 2 years ago

Hello, for https://equalitytime.github.io/TheOpenVoiceFactory-site/, I need to access extract sounds programatically. I'm starting with a fart sound (from wikipedia) because that's what the user wants.

My MCVE is: mcve.pptx

I normally access the links like this:

    if shape.shape_type != MSO_SHAPE_TYPE.GROUP:
                click_action = shape.click_action
                if click_action.hyperlink.address is not None:
                    self.links[co][ro] = click_action.hyperlink.address

and throwing a print(shape._sp.xml)in there gives me (partly)

My question is - how do I detect the existance of Fart.wav within the link? (and save it somewhere useful). I get the impression from other issues that this has been fairly recently discussed so it might have changed with recent updates...