Esempio n. 1
0
 def process(self, wave_data: numpy.ndarray):
     if len(self.track) < len(wave_data):
         beat_track = numpy.tile(self.track,
                                 (len(wave_data) // len(self.track)) + 1)
         return mix_tracks(beat_track * 0.4, wave_data, align="center")
     else:
         return wave_data
Esempio n. 2
0
 def process(self, wave_data: numpy.ndarray):
     with open("tools/data/ambiance/war_mood.wav", "rb") as sndfile:
         rate, track_data = read(sndfile)
     # rnd_pos = random.randint(0,len(track_data) - len(wave_data))
     print(len(track_data))
     return mix_tracks(track_data[rate * 3:len(wave_data) + rate * 5] * 0.4,
                       wave_data,
                       align="center")
Esempio n. 3
0
    def process(self, wave_data: np.ndarray):
        if random.randint(1, 2) == 1:
            sample = random.choice(self.samples) * 0.3
            if self.type_folder == "burps":
                wave_data = np.insert(wave_data, random.randint(1, len(wave_data)), sample)
            else:
                wave_data = mix_tracks(wave_data, sample, offset=random.randint(1, len(wave_data)))

        return wave_data
Esempio n. 4
0
 def process(self, wave_data: np.ndarray):
     padding_time = self.rate * 2
     rnd_pos = random.randint(
         0,
         len(self.track_data) - len(wave_data) - padding_time)
     return mix_tracks(self.track_data[rnd_pos:rnd_pos +
                                       len(wave_data) + padding_time] *
                       self.gain,
                       wave_data * 1.2,
                       align="center")
Esempio n. 5
0
    def process(self, wave_data: numpy.ndarray):
        if random.randint(0,1):
            randoum = random.randint(1, 3)
            if randoum == 1:
                wave_data = numpy.concatenate((wave_data, random.choice(self.tracks["laugh_track"])))
            elif randoum == 2:
                wave_data = numpy.concatenate((wave_data, random.choice(self.tracks["applaud"])))
            elif randoum == 3:
                boo_track_id = self.find_nearest(self.tracks["boo"], len(wave_data))
                wave_data = mix_tracks(wave_data, self.tracks["boo"][boo_track_id], align="right")

        return wave_data
Esempio n. 6
0
    def process(self, wave_data: numpy.ndarray):
        if random.randint(0,1):
            randoum = random.randint(1, 3)
            if randoum == 1:
                wave_data = numpy.concatenate((wave_data, random.choice(self.tracks["laugh_track"])))
            elif randoum == 2:
                wave_data = numpy.concatenate((wave_data, random.choice(self.tracks["applaud"])))
            elif randoum == 3:
                boo_track_id = self.find_nearest(self.tracks["boo"], len(wave_data))
                wave_data = mix_tracks(wave_data, self.tracks["boo"][boo_track_id], align="right")

        return wave_data
Esempio n. 7
0
 def process(self, wave_data: numpy.ndarray):
     if len(self.track) < len(wave_data):
         beat_track = numpy.tile(self.track, (len(wave_data) // len(self.track)) + 1)
         return mix_tracks(beat_track * 0.4, wave_data, align="center")
     else:
         return wave_data
Esempio n. 8
0
 def process(self, wave_data: numpy.ndarray):
     padding_time = self.rate * 2
     rnd_pos = random.randint(0, len(self.track_data) - len(wave_data) - padding_time)
     return mix_tracks(self.track_data[rnd_pos:rnd_pos + len(wave_data) + padding_time] * self.gain,
                       wave_data,
                       align="center")
Esempio n. 9
0
 def process(self, wave_data: np.ndarray) -> np.ndarray:
     padding_time = self.rate * 1.5
     rnd_pos = random.randint(0, len(self.fx_wave_array) - len(wave_data) - padding_time)
     return mix_tracks(self.fx_wave_array[rnd_pos:rnd_pos + len(wave_data) + int(padding_time)] * 1.3,
                       wave_data,
                       align="center")
Esempio n. 10
0
 def process(self, wave_data: np.ndarray):
     with open("tools/data/ambiance/war_mood.wav", "rb") as sndfile:
         rate, track_data = read(sndfile)
     # rnd_pos = random.randint(0,len(track_data) - len(wave_data))
     print(len(track_data))
     return mix_tracks(track_data[rate*3:len(wave_data) + rate*5] * 0.4, wave_data, align="center")