Vaibhav Srivastav commited on
Commit
7283b95
1 Parent(s): a1a31ea
Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -15,7 +15,7 @@ language:
15
  - zh
16
  thumbnail: https://user-images.githubusercontent.com/5068315/230698495-cbb1ced9-c911-4c9a-941d-a1a4a1286ac6.png
17
  library: "bark"
18
- license: "CC-BY 4.0 NC"
19
  ---
20
 
21
  # Bark
@@ -24,6 +24,37 @@ This is the official codebase for running the text to audio model, from Suno.ai.
24
 
25
  The following is additional information about the models released here.
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ## Model Details
28
 
29
  Bark is a series of three transformer models that turn text into audio.
 
15
  - zh
16
  thumbnail: https://user-images.githubusercontent.com/5068315/230698495-cbb1ced9-c911-4c9a-941d-a1a4a1286ac6.png
17
  library: "bark"
18
+ license: "cc-by-nc-4.0"
19
  ---
20
 
21
  # Bark
 
24
 
25
  The following is additional information about the models released here.
26
 
27
+ ## Model Usage
28
+
29
+ ```python
30
+ from bark import SAMPLE_RATE, generate_audio, preload_models
31
+ from IPython.display import Audio
32
+
33
+ # download and load all models
34
+ preload_models()
35
+
36
+ # generate audio from text
37
+ text_prompt = """
38
+ Hello, my name is Suno. And, uh — and I like pizza. [laughs]
39
+ But I also have other interests such as playing tic tac toe.
40
+ """
41
+ audio_array = generate_audio(text_prompt)
42
+
43
+ # play text in notebook
44
+ Audio(audio_array, rate=SAMPLE_RATE)
45
+ ```
46
+
47
+ [pizza.webm](https://user-images.githubusercontent.com/5068315/230490503-417e688d-5115-4eee-9550-b46a2b465ee3.webm)
48
+
49
+
50
+ To save `audio_array` as a WAV file:
51
+
52
+ ```python
53
+ from scipy.io.wavfile import write as write_wav
54
+
55
+ write_wav("/path/to/audio.wav", SAMPLE_RATE, audio_array)
56
+ ```
57
+
58
  ## Model Details
59
 
60
  Bark is a series of three transformer models that turn text into audio.