im trying to make a python morse code translater, which takes in a string and should return a wav file containing morse code.
now my problem is, how do i edit or create a wav file from text?
i wanted to do something like this (not real code):
def morse_to_wav(morse):
for char in morse:
if char == '.':
wavfile add "short.wav" ## just adds the sound to an existing wav file
if char == '-':
wavfile add "long.wav" ## same here
if char == ' ':
wavfile add "pause.wav" ## same here
do you have any idea what i could do? or any other solution?
Soooo, I found a solution to my problem: I mixed everything i found and this is what I got: thanks to @Sembei Norimaki @Mathhew Walker (idk how to tag people) I used code from this post (thats from Mathhew Walker) Basically, i read my audio files, put them in a list, concatenate that and then use write to make a wav file. Its not very pretty but it works