Closed ThePyceIsRight closed 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:
Image
instance either by loading an image (see line 41 of __main__.py
) or drawing one from scratch in memory.SSTV
based on which mode you want to use (e.g. MartinM1
for Martin M1 mode), passing the image instance, the sampling rate and the sample size as arguments (see line 70 in __main__.py
).write_wav
method of that object with the name of the output WAV file passed as the sole argument (see line 76 in __main__.py
).
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") `