File size: 463 Bytes
fe62fb4
 
54adc39
3ac9f34
 
c5e1f80
3ac9f34
54adc39
dcfe0d4
 
3ac9f34
 
c5e1f80
e366cd5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import audiofile
import numpy as np
from audiocraft import AudioGen
text_list = ['dogs barging in the street',
             'cats meowing']

sound_generator = AudioGen(duration=0.24,
                           device='cuda:0').to('cuda:0').eval()
x = sound_generator.generate(text_list)  # [bs, 1, 7680]
# print('demo', x.shape)
x = x[1, :, :].detach().cpu().numpy()
# x /= np.abs(x).max() + 1e-7   # inside generate()

audiofile.write('del_seane.wav', x, 16000)