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
from scipy.io.wavfile import write
import wave, numpy
def get_npaudiodata(audiofile):
# Read file to get buffer
ifile = wave.open(audiofile)
samples = ifile.getnframes()
audio = ifile.readframes(samples)
# Convert buffer to float32 using NumPy
audio_as_np_int16 = numpy.frombuffer(audio, dtype=numpy.int16)
audio_as_np_float32 = audio_as_np_int16.astype(numpy.float32)
# Normalise float32 array so that values are between -1.0 and +1.0
max_int16 = 2**15
audio_normalised = audio_as_np_float32 / max_int16
return audio_normalised
audio_short = get_npaudiodata("short.wav")
audio_long = get_npaudiodata("long.wav")
audio_pause = get_npaudiodata("pause.wav")
nlist = [audio_short,audio_short,audio_short,audio_long,audio_long,audio_long,audio_short,audio_short,audio_short] #Thats SOS in morse
nparray = numpy.concatenate(nlist, axis=None)
write("example.wav", 10000, nparray)