dnet / pySSTV

Python classes for generating Slow-scan Television transmissions
https://pypi.python.org/pypi/PySSTV
MIT License
138 stars 27 forks source link

write to wav #33

Closed ThePyceIsRight closed 1 year ago

ThePyceIsRight commented 1 year ago

Can you please give an example of how to use this in python? I am a novice coder, so the ReadME goes above my head. I just want to convert an image to a .wav. I have installed pysstv, I have imported it and I am trying to use the write_to_wav method. I am stuck on the self argument. It's probably an obvious issue for someone with advanced developer knowledge, but I dont know what to put there. See code below:

` from pysstv.sstv import SSTV

def convert(): object = SSTV.write_wav(self=????????????,filename="assets/image1.jpg") `

dnet commented 1 year ago

If you would like to use it from your own Python code (as opposed to running it as a command line program), you should take a look at pysstv/__main__.py and see how that calls the various methods based on the parse command line arguments.

Also, based on your numerous question marks regarding the parameter self maybe you should also learn more about object-oriented Python: https://realpython.com/python3-object-oriented-programming/

Using PySSTV from Python basically boils down to this: