runapi-fish-audio 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9fd6b819eda0904ba61469869f1dfcff70383e37ed8fd9569725d13bf191e75
4
- data.tar.gz: 5d0320373d6ef183151f302acf43a4c7a7ab80e52cba88d6749eb784517493dc
3
+ metadata.gz: 370d607320f1810125fdf732de7b8ec975b26ca62c47b1886338601ebdec10db
4
+ data.tar.gz: 86236d72fc06d5e105701df377d11542d5b291828c4cad809017505d1a85c58f
5
5
  SHA512:
6
- metadata.gz: e28da12b4c40da5f2b3db11218ac6365a07c5b9ce019e91d6e1455c91f98ab3ea7db9689f6800a0c0fed16c1c26e72dbcf92befced086728fbca7ba3160808b7
7
- data.tar.gz: 995c1b6b1ed7585467f843bb78b4bd8f6585e4fbda5cb1675890fe5cd1e15cf6d0ace0913db157f6244324381597eae32ac96b011be9e97bd69349a1656defd1
6
+ metadata.gz: 57c267f3e0e8cf89caef1f2d7032363b79a8e7ae3809350887936a2e0d29912f56e8e3e2bea6fd1c0fc04076ab21cf084dd7f7c17a681fadda68cf8f243777b8
7
+ data.tar.gz: 100dfc8467279f6b2901f44269962fdb3d4ca630aa83cf5a50bcdc632fdd0572257aabe4ea7728730156fa7f6d8fa9e6a4e86d0acf31f9c7faa97b5ef024d19a
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Fish Audio Ruby SDK for RunAPI
2
2
 
3
- Install `runapi-fish-audio`, create `RunApi::FishAudio::Client`, and call `client.text_to_speech.run(model: "s1", text: "Hello")`.
3
+ Install `runapi-fish-audio`, create `RunApi::FishAudio::Client`, and call `client.text_to_speech.run(model: "s2.1-pro", text: "Hello [excited]", output_format: "wav", sample_rate_hz: 44_100)`.
4
4
 
5
5
  Pass optional `references` entries with base64-encoded raw audio bytes and exact transcripts for request-scoped voice matching.
6
6
 
7
- Model details and pricing: https://runapi.ai/models/fish-audio
7
+ The output defaults to MP3. Select WAV with `output_format`; `bitrate_kbps` applies only to MP3.
8
+
9
+ Model details and pricing: https://runapi.ai/models/fish-audio/s2.1-pro
8
10
 
9
11
  Licensed under the Apache License, Version 2.0.
@@ -4,25 +4,88 @@ module RunApi
4
4
  module FishAudio
5
5
  CONTRACT = {
6
6
  "text-to-speech" => {
7
- "models" => ["s1", "s2-pro"],
7
+ "models" => ["s1", "s2-pro", "s2.1-pro"],
8
8
  "fields_by_model" => {
9
9
  "s1" => {
10
+ "bitrate_kbps" => {
11
+ "enum" => [64, 128, 192],
12
+ "type" => "integer"
13
+ },
10
14
  "model" => {
11
15
  "required" => true
12
16
  },
17
+ "output_format" => {
18
+ "enum" => ["mp3", "wav"]
19
+ },
20
+ "sample_rate_hz" => {
21
+ "enum" => [8000, 16000, 24000, 32000, 44100],
22
+ "type" => "integer"
23
+ },
13
24
  "text" => {
14
25
  "required" => true
15
26
  }
16
27
  },
17
28
  "s2-pro" => {
29
+ "bitrate_kbps" => {
30
+ "enum" => [64, 128, 192],
31
+ "type" => "integer"
32
+ },
33
+ "model" => {
34
+ "required" => true
35
+ },
36
+ "output_format" => {
37
+ "enum" => ["mp3", "wav"]
38
+ },
39
+ "sample_rate_hz" => {
40
+ "enum" => [8000, 16000, 24000, 32000, 44100],
41
+ "type" => "integer"
42
+ },
43
+ "text" => {
44
+ "required" => true
45
+ }
46
+ },
47
+ "s2.1-pro" => {
48
+ "bitrate_kbps" => {
49
+ "enum" => [64, 128, 192],
50
+ "type" => "integer"
51
+ },
18
52
  "model" => {
19
53
  "required" => true
20
54
  },
55
+ "output_format" => {
56
+ "enum" => ["mp3", "wav"]
57
+ },
58
+ "sample_rate_hz" => {
59
+ "enum" => [8000, 16000, 24000, 32000, 44100],
60
+ "type" => "integer"
61
+ },
21
62
  "text" => {
22
63
  "required" => true
23
64
  }
24
65
  }
25
- }
66
+ },
67
+ "rules" => [{
68
+ "when" => {
69
+ "output_format" => "wav"
70
+ },
71
+ "forbidden" => ["bitrate_kbps"]
72
+ }, {
73
+ "enum" => {
74
+ "sample_rate_hz" => [32000, 44100]
75
+ },
76
+ "when" => {
77
+ "output_format" => "mp3"
78
+ }
79
+ }, {
80
+ "enum" => {
81
+ "sample_rate_hz" => [32000, 44100]
82
+ },
83
+ "when" => {
84
+ "output_format" => {
85
+ "present" => false
86
+ }
87
+ }
88
+ }]
26
89
  }
27
90
  }.freeze
28
91
  end
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module FishAudio
5
5
  module Resources
6
- # Generates RunAPI-managed MP3 speech from text.
6
+ # Generates RunAPI-managed MP3 or WAV speech from text.
7
7
  class TextToSpeech
8
8
  include RunApi::Core::ResourceHelpers
9
9
 
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module FishAudio
5
5
  module Types
6
- # A RunAPI-managed MP3 audio result.
6
+ # A RunAPI-managed audio result.
7
7
  class Audio < RunApi::Core::BaseModel
8
8
  required :url, String
9
9
  required :format, String
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-fish-audio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,16 +15,17 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.3.0
18
+ version: 0.3.3
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.3.0
25
+ version: 0.3.3
26
26
  description: 'Install `runapi-fish-audio`, create `RunApi::FishAudio::Client`, and
27
- call `client.text_to_speech.run(model: "s1", text: "Hello")`.'
27
+ call `client.text_to_speech.run(model: "s2.1-pro", text: "Hello [excited]", output_format:
28
+ "wav", sample_rate_hz: 44_100)`.'
28
29
  email:
29
30
  - contact@runapi.ai
30
31
  executables: []