vocalstack 1.0.0a3__tar.gz → 1.0.0a5__tar.gz
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.
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/PKG-INFO +4 -4
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/README.md +3 -3
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/SKILL.md +2 -2
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/pyproject.toml +1 -1
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/skills/vocalstack/SKILL.md +2 -2
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/__init__.py +1 -1
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/_models.py +106 -76
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/client.py +2 -0
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/resources.py +112 -76
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/.gitignore +0 -0
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/LICENSE +0 -0
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/_http.py +0 -0
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/errors.py +0 -0
- {vocalstack-1.0.0a3 → vocalstack-1.0.0a5}/src/vocalstack/realtime.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vocalstack
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a5
|
|
4
4
|
Summary: VocalStack speech API SDK (asyncio): one client grouped by resource, typed models from the API contract, realtime WebSocket streaming.
|
|
5
5
|
Project-URL: Homepage, https://vocalstack.com
|
|
6
6
|
License-Expression: MIT
|
|
@@ -69,13 +69,13 @@ pip install vocalstack
|
|
|
69
69
|
| recording | one take inside a broadcast or a transcription | `vs.recordings` |
|
|
70
70
|
| job | a file or link recording's transcription work | `vs.jobs` |
|
|
71
71
|
|
|
72
|
-
The other groups: `vs.corrections`, `vs.share_links`, `vs.
|
|
73
|
-
`vs.search`, `vs.me`, `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
72
|
+
The other groups: `vs.corrections`, `vs.share_links`, `vs.speakers`,
|
|
73
|
+
`vs.voices`, `vs.search`, `vs.me`, `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
74
74
|
Method names are the document's `operationId`s in snake_case
|
|
75
75
|
(`broadcasts.start_recording` is `POST /v1/broadcasts/{id}/recordings`).
|
|
76
76
|
Request fields are keyword arguments, in snake_case or the wire's camelCase
|
|
77
77
|
(`settings={"spokenLanguage": "en"}`); lists return lists; binary answers
|
|
78
|
-
(`recordings.export`, `recordings.clip`, `
|
|
78
|
+
(`recordings.export`, `recordings.clip`, `speakers.sample`, ...) return bytes.
|
|
79
79
|
|
|
80
80
|
```python
|
|
81
81
|
VocalStack(
|
|
@@ -56,13 +56,13 @@ pip install vocalstack
|
|
|
56
56
|
| recording | one take inside a broadcast or a transcription | `vs.recordings` |
|
|
57
57
|
| job | a file or link recording's transcription work | `vs.jobs` |
|
|
58
58
|
|
|
59
|
-
The other groups: `vs.corrections`, `vs.share_links`, `vs.
|
|
60
|
-
`vs.search`, `vs.me`, `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
59
|
+
The other groups: `vs.corrections`, `vs.share_links`, `vs.speakers`,
|
|
60
|
+
`vs.voices`, `vs.search`, `vs.me`, `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
61
61
|
Method names are the document's `operationId`s in snake_case
|
|
62
62
|
(`broadcasts.start_recording` is `POST /v1/broadcasts/{id}/recordings`).
|
|
63
63
|
Request fields are keyword arguments, in snake_case or the wire's camelCase
|
|
64
64
|
(`settings={"spokenLanguage": "en"}`); lists return lists; binary answers
|
|
65
|
-
(`recordings.export`, `recordings.clip`, `
|
|
65
|
+
(`recordings.export`, `recordings.clip`, `speakers.sample`, ...) return bytes.
|
|
66
66
|
|
|
67
67
|
```python
|
|
68
68
|
VocalStack(
|
|
@@ -226,9 +226,9 @@ except VocalStackError as e:
|
|
|
226
226
|
## More
|
|
227
227
|
|
|
228
228
|
- The other groups: `vs.transcriptions` (`list`, `get`, `update`, `archive`,
|
|
229
|
-
`restore`, `purge`, `list_share_links`, `create_share_link`), `vs.recordings`
|
|
229
|
+
`restore`, `purge`, `list_share_links`, `create_share_link`, `list_scripts`), `vs.recordings`
|
|
230
230
|
(`get`, `summarize`, `summary`, `translation`, `audio_url`, `subscribe`),
|
|
231
|
-
`vs.corrections`, `vs.share_links`, `vs.voices`, `vs.broadcasts`,
|
|
231
|
+
`vs.corrections`, `vs.share_links`, `vs.speakers`, `vs.voices`, `vs.broadcasts`,
|
|
232
232
|
`vs.me` (`get`, `usage`), `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
233
233
|
Each method is its operation's name in the OpenAPI document, in snake_case
|
|
234
234
|
(`transcriptions.create` is `POST /v1/transcriptions`).
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vocalstack"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.0a5"
|
|
8
8
|
description = "VocalStack speech API SDK (asyncio): one client grouped by resource, typed models from the API contract, realtime WebSocket streaming."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -226,9 +226,9 @@ except VocalStackError as e:
|
|
|
226
226
|
## More
|
|
227
227
|
|
|
228
228
|
- The other groups: `vs.transcriptions` (`list`, `get`, `update`, `archive`,
|
|
229
|
-
`restore`, `purge`, `list_share_links`, `create_share_link`), `vs.recordings`
|
|
229
|
+
`restore`, `purge`, `list_share_links`, `create_share_link`, `list_scripts`), `vs.recordings`
|
|
230
230
|
(`get`, `summarize`, `summary`, `translation`, `audio_url`, `subscribe`),
|
|
231
|
-
`vs.corrections`, `vs.share_links`, `vs.voices`, `vs.broadcasts`,
|
|
231
|
+
`vs.corrections`, `vs.share_links`, `vs.speakers`, `vs.voices`, `vs.broadcasts`,
|
|
232
232
|
`vs.me` (`get`, `usage`), `vs.languages`, `vs.rtmp`, `vs.events`, `vs.meta`.
|
|
233
233
|
Each method is its operation's name in the OpenAPI document, in snake_case
|
|
234
234
|
(`transcriptions.create` is `POST /v1/transcriptions`).
|
|
@@ -140,6 +140,25 @@ class AppStreamKey(_Base):
|
|
|
140
140
|
name: str
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
class CloneRef(_Base):
|
|
144
|
+
id: str
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class AppearanceView(_Base):
|
|
148
|
+
gender: Optional[str] = None
|
|
149
|
+
gender_confidence: Optional[float] = Field(default=None, alias="genderConfidence")
|
|
150
|
+
identified: Optional[bool] = None
|
|
151
|
+
identified_confidence: Optional[float] = Field(default=None, alias="identifiedConfidence")
|
|
152
|
+
name: str
|
|
153
|
+
number: Optional[int] = None
|
|
154
|
+
returning: Optional[bool] = None
|
|
155
|
+
speaker: int
|
|
156
|
+
speaker_color: Optional[str] = Field(default=None, alias="speakerColor")
|
|
157
|
+
speaker_id: Optional[str] = Field(default=None, alias="speakerId")
|
|
158
|
+
speech_s: Optional[float] = Field(default=None, alias="speechS")
|
|
159
|
+
voice: Optional["CloneRef"] = None
|
|
160
|
+
|
|
161
|
+
|
|
143
162
|
class AudioCapabilities(_Base):
|
|
144
163
|
channels: List[int]
|
|
145
164
|
encodings: List[AudioEncoding]
|
|
@@ -274,9 +293,9 @@ class Limits2(_Base):
|
|
|
274
293
|
questions_per_day: Optional[int] = Field(default=None, alias="questionsPerDay")
|
|
275
294
|
requests_per_min: Optional[int] = Field(default=None, alias="requestsPerMin")
|
|
276
295
|
retention_audio_days: Optional[int] = Field(default=None, alias="retentionAudioDays")
|
|
296
|
+
retention_speakers_days: Optional[int] = Field(default=None, alias="retentionSpeakersDays")
|
|
277
297
|
retention_transcriptions_days: Optional[int] = Field(default=None, alias="retentionTranscriptionsDays")
|
|
278
298
|
retention_video_days: Optional[int] = Field(default=None, alias="retentionVideoDays")
|
|
279
|
-
retention_voices_days: Optional[int] = Field(default=None, alias="retentionVoicesDays")
|
|
280
299
|
vector_searches_per_hour: Optional[int] = Field(default=None, alias="vectorSearchesPerHour")
|
|
281
300
|
|
|
282
301
|
|
|
@@ -632,6 +651,22 @@ class ClientPolicy(_Base):
|
|
|
632
651
|
unsupported_below: Optional[str] = Field(default=None, alias="unsupportedBelow")
|
|
633
652
|
|
|
634
653
|
|
|
654
|
+
class Clone(_Base):
|
|
655
|
+
"""A speaker's cloned voice: the sound, built from the speaker's sample.
|
|
656
|
+
Its id is the speaker's, so `clone:<id>` names it as a voice."""
|
|
657
|
+
|
|
658
|
+
disabled_at: Optional[str] = Field(default=None, alias="disabledAt")
|
|
659
|
+
enabled: bool
|
|
660
|
+
error: Optional[str] = None
|
|
661
|
+
id: str
|
|
662
|
+
preview_url: Optional[str] = Field(default=None, alias="previewUrl")
|
|
663
|
+
progress: int
|
|
664
|
+
sample_s: float = Field(alias="sampleS")
|
|
665
|
+
speech_s: Optional[float] = Field(default=None, alias="speechS")
|
|
666
|
+
state: str
|
|
667
|
+
uses: int
|
|
668
|
+
|
|
669
|
+
|
|
635
670
|
class CommittedSegment(_Base):
|
|
636
671
|
catchup: Optional[bool] = None
|
|
637
672
|
confidence: Optional[float] = None
|
|
@@ -757,6 +792,32 @@ class CreateShareLink(_Base):
|
|
|
757
792
|
label: str
|
|
758
793
|
|
|
759
794
|
|
|
795
|
+
class CreateSpeaker(_Base):
|
|
796
|
+
color: Optional[str] = None
|
|
797
|
+
consent: Optional[bool] = None
|
|
798
|
+
draft: Optional[bool] = None
|
|
799
|
+
gender: Optional[str] = None
|
|
800
|
+
name: str
|
|
801
|
+
sample_url: Optional[str] = Field(default=None, alias="sampleUrl")
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
class SampleSpan(_Base):
|
|
805
|
+
end: float
|
|
806
|
+
start: float
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
class CreateSpeakerFromAppearance(_Base):
|
|
810
|
+
appearance: int
|
|
811
|
+
color: Optional[str] = None
|
|
812
|
+
consent: Optional[bool] = None
|
|
813
|
+
draft: Optional[bool] = None
|
|
814
|
+
library: Optional[bool] = None
|
|
815
|
+
name: str
|
|
816
|
+
recording_id: Optional[str] = Field(default=None, alias="recordingId")
|
|
817
|
+
spans: Optional[List["SampleSpan"]] = None
|
|
818
|
+
transcription_id: str = Field(alias="transcriptionId")
|
|
819
|
+
|
|
820
|
+
|
|
760
821
|
class CreateTag(_Base):
|
|
761
822
|
color: Optional[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"]] = None
|
|
762
823
|
name: str
|
|
@@ -796,31 +857,6 @@ multipart upload whose `file` part carries the media."""
|
|
|
796
857
|
url: Optional[str] = None
|
|
797
858
|
|
|
798
859
|
|
|
799
|
-
class CreateVoice(_Base):
|
|
800
|
-
color: Optional[str] = None
|
|
801
|
-
consent: Optional[bool] = None
|
|
802
|
-
draft: Optional[bool] = None
|
|
803
|
-
gender: Optional[str] = None
|
|
804
|
-
name: str
|
|
805
|
-
sample_url: Optional[str] = Field(default=None, alias="sampleUrl")
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
class SampleSpan(_Base):
|
|
809
|
-
end: float
|
|
810
|
-
start: float
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
class CreateVoiceFromSpeaker(_Base):
|
|
814
|
-
color: Optional[str] = None
|
|
815
|
-
consent: Optional[bool] = None
|
|
816
|
-
draft: Optional[bool] = None
|
|
817
|
-
library: Optional[bool] = None
|
|
818
|
-
name: str
|
|
819
|
-
recording_id: str = Field(alias="recordingId")
|
|
820
|
-
spans: Optional[List["SampleSpan"]] = None
|
|
821
|
-
speaker: int
|
|
822
|
-
|
|
823
|
-
|
|
824
860
|
class CreatedAppStreamKey(_Base):
|
|
825
861
|
"""The answer that made an app stream key: the one time it is in full."""
|
|
826
862
|
|
|
@@ -897,15 +933,14 @@ class JobQueue(_Base):
|
|
|
897
933
|
reason: QueueReason
|
|
898
934
|
|
|
899
935
|
|
|
900
|
-
class
|
|
901
|
-
"""One
|
|
936
|
+
class KnownSpeaker(_Base):
|
|
937
|
+
"""One saved speaker a realtime session may recognise a speaker as.
|
|
902
938
|
|
|
903
|
-
The `id` is a
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
narration" belongs to a person called Marcus Reed."""
|
|
939
|
+
The `id` is a saved speaker's id (`GET /v1/speakers`); the server
|
|
940
|
+
supplies their fingerprint, so a caller names the speaker and never
|
|
941
|
+
carries a vector over the wire. `name` is what to call the person
|
|
942
|
+
when they are recognised — the speaker's own name, ordinarily, but the
|
|
943
|
+
caller's to choose."""
|
|
909
944
|
|
|
910
945
|
color: Optional[str] = None
|
|
911
946
|
id: str
|
|
@@ -1037,7 +1072,7 @@ model as context, with `mediaStart` to cite or play the moment."""
|
|
|
1037
1072
|
text: str
|
|
1038
1073
|
|
|
1039
1074
|
|
|
1040
|
-
class
|
|
1075
|
+
class PatchSpeaker(_Base):
|
|
1041
1076
|
color: Optional[str] = None
|
|
1042
1077
|
consent: Optional[bool] = None
|
|
1043
1078
|
draft: Optional[bool] = None
|
|
@@ -1280,6 +1315,23 @@ class RtmpStatus(_Base):
|
|
|
1280
1315
|
stream_key: Optional[str] = Field(default=None, alias="streamKey")
|
|
1281
1316
|
|
|
1282
1317
|
|
|
1318
|
+
class Script(_Base):
|
|
1319
|
+
"""The broadcast or transcription something belongs to (a script, a share
|
|
1320
|
+
link): exactly one of `broadcastId` and `transcriptionId` is set.
|
|
1321
|
+
Flattened into its owner."""
|
|
1322
|
+
|
|
1323
|
+
broadcast_id: Optional[str] = Field(default=None, alias="broadcastId")
|
|
1324
|
+
created_at: str = Field(alias="createdAt")
|
|
1325
|
+
id: str
|
|
1326
|
+
locked: bool
|
|
1327
|
+
recording_id: Optional[str] = Field(default=None, alias="recordingId")
|
|
1328
|
+
scheduled_at: Optional[str] = Field(default=None, alias="scheduledAt")
|
|
1329
|
+
text: str
|
|
1330
|
+
transcription_id: Optional[str] = Field(default=None, alias="transcriptionId")
|
|
1331
|
+
updated_at: str = Field(alias="updatedAt")
|
|
1332
|
+
word_count: int = Field(alias="wordCount")
|
|
1333
|
+
|
|
1334
|
+
|
|
1283
1335
|
class SearchHit(_Base):
|
|
1284
1336
|
link_code: str = Field(alias="linkCode")
|
|
1285
1337
|
link_name: str = Field(alias="linkName")
|
|
@@ -1371,6 +1423,7 @@ class SentenceView(_Base):
|
|
|
1371
1423
|
class SpeakerNumber(_Base):
|
|
1372
1424
|
name: Optional[str] = None
|
|
1373
1425
|
number: int
|
|
1426
|
+
returning: Optional[bool] = None
|
|
1374
1427
|
speaker: int
|
|
1375
1428
|
|
|
1376
1429
|
|
|
@@ -1383,7 +1436,7 @@ class SessionStats(_Base):
|
|
|
1383
1436
|
class SessionOptions(_Base):
|
|
1384
1437
|
audio: Optional["AudioFormat"] = None
|
|
1385
1438
|
events: Optional["EventOptions"] = None
|
|
1386
|
-
|
|
1439
|
+
identify_speakers: Optional[List["KnownSpeaker"]] = Field(default=None, alias="identifySpeakers")
|
|
1387
1440
|
input: Optional["InputOptions"] = None
|
|
1388
1441
|
latency_mode: Optional[LatencyMode] = Field(default=None, alias="latencyMode")
|
|
1389
1442
|
sentences: Optional["SentenceOptions"] = None
|
|
@@ -1397,8 +1450,8 @@ class SessionOptions(_Base):
|
|
|
1397
1450
|
|
|
1398
1451
|
|
|
1399
1452
|
class SetConsent(_Base):
|
|
1400
|
-
"""`POST /v1/
|
|
1401
|
-
agreed to their
|
|
1453
|
+
"""`POST /v1/speakers/{id}/consent`: the owner records whether the speaker
|
|
1454
|
+
agreed to have their voice cloned."""
|
|
1402
1455
|
|
|
1403
1456
|
consent: Consent
|
|
1404
1457
|
name: Optional[str] = None
|
|
@@ -1471,17 +1524,20 @@ plus job state to read from."""
|
|
|
1471
1524
|
transcription_id: Optional[str] = Field(default=None, alias="transcriptionId")
|
|
1472
1525
|
|
|
1473
1526
|
|
|
1474
|
-
class
|
|
1527
|
+
class Speaker(_Base):
|
|
1528
|
+
archived_at: Optional[str] = Field(default=None, alias="archivedAt")
|
|
1529
|
+
color: Optional[str] = None
|
|
1530
|
+
consent: Consent
|
|
1531
|
+
consent_at: Optional[str] = Field(default=None, alias="consentAt")
|
|
1532
|
+
created_at: str = Field(alias="createdAt")
|
|
1533
|
+
draft: bool
|
|
1475
1534
|
gender: Optional[str] = None
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
identified_confidence: Optional[float] = Field(default=None, alias="identifiedConfidence")
|
|
1535
|
+
id: str
|
|
1536
|
+
library: Optional[bool] = None
|
|
1479
1537
|
name: str
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
voice_color: Optional[str] = Field(default=None, alias="voiceColor")
|
|
1484
|
-
voice_id: Optional[str] = Field(default=None, alias="voiceId")
|
|
1538
|
+
recording_id: Optional[str] = Field(default=None, alias="recordingId")
|
|
1539
|
+
updated_at: str = Field(alias="updatedAt")
|
|
1540
|
+
voice: Optional["Clone"] = None
|
|
1485
1541
|
|
|
1486
1542
|
|
|
1487
1543
|
class StartJob(_Base):
|
|
@@ -1549,7 +1605,7 @@ class TranscriptSnapshot(_Base):
|
|
|
1549
1605
|
sentences: List["SentenceView"]
|
|
1550
1606
|
spans: List["CaptureSpan"]
|
|
1551
1607
|
speaker_labels: Optional[SpeakerLabels] = Field(default=None, alias="speakerLabels")
|
|
1552
|
-
speakers: List["
|
|
1608
|
+
speakers: List["AppearanceView"]
|
|
1553
1609
|
state: RecordingState
|
|
1554
1610
|
translation_pending: Optional[bool] = Field(default=None, alias="translationPending")
|
|
1555
1611
|
|
|
@@ -1723,32 +1779,6 @@ class VectorResults(_Base):
|
|
|
1723
1779
|
state: str
|
|
1724
1780
|
|
|
1725
1781
|
|
|
1726
|
-
class Voice(_Base):
|
|
1727
|
-
archived_at: Optional[str] = Field(default=None, alias="archivedAt")
|
|
1728
|
-
auto: Optional[bool] = None
|
|
1729
|
-
color: Optional[str] = None
|
|
1730
|
-
consent: Consent
|
|
1731
|
-
consent_at: Optional[str] = Field(default=None, alias="consentAt")
|
|
1732
|
-
created_at: str = Field(alias="createdAt")
|
|
1733
|
-
disabled_at: Optional[str] = Field(default=None, alias="disabledAt")
|
|
1734
|
-
draft: bool
|
|
1735
|
-
enabled: bool
|
|
1736
|
-
error: Optional[str] = None
|
|
1737
|
-
gender: Optional[str] = None
|
|
1738
|
-
id: str
|
|
1739
|
-
library: Optional[bool] = None
|
|
1740
|
-
name: str
|
|
1741
|
-
preview_url: Optional[str] = Field(default=None, alias="previewUrl")
|
|
1742
|
-
progress: int
|
|
1743
|
-
recording_id: Optional[str] = Field(default=None, alias="recordingId")
|
|
1744
|
-
sample_s: float = Field(alias="sampleS")
|
|
1745
|
-
speaker: Optional[int] = None
|
|
1746
|
-
speech_s: Optional[float] = Field(default=None, alias="speechS")
|
|
1747
|
-
state: str
|
|
1748
|
-
updated_at: str = Field(alias="updatedAt")
|
|
1749
|
-
uses: int
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
1782
|
class VoiceOption(_Base):
|
|
1753
1783
|
accent: Optional[str] = None
|
|
1754
1784
|
auto: Optional[bool] = None
|
|
@@ -1910,9 +1940,9 @@ class TranscriptSpeakerIdentified(_Base):
|
|
|
1910
1940
|
confidence: Optional[float] = None
|
|
1911
1941
|
name: str
|
|
1912
1942
|
speaker: int
|
|
1943
|
+
speaker_id: Optional[str] = Field(default=None, alias="speakerId")
|
|
1913
1944
|
tone: Optional[bool] = None
|
|
1914
1945
|
type: Literal["transcript.speakerIdentified"] = "transcript.speakerIdentified"
|
|
1915
|
-
voice_id: Optional[str] = Field(default=None, alias="voiceId")
|
|
1916
1946
|
|
|
1917
1947
|
|
|
1918
1948
|
class TranscriptSpeakerNumbers(_Base):
|
|
@@ -2106,8 +2136,8 @@ class TranscriptSpeakerIdentified(_Base):
|
|
|
2106
2136
|
confidence: Optional[float] = None
|
|
2107
2137
|
name: str
|
|
2108
2138
|
speaker: int
|
|
2139
|
+
speaker_id: Optional[str] = Field(default=None, alias="speakerId")
|
|
2109
2140
|
type: Literal["transcript.speakerIdentified"] = "transcript.speakerIdentified"
|
|
2110
|
-
voice_id: Optional[str] = Field(default=None, alias="voiceId")
|
|
2111
2141
|
|
|
2112
2142
|
|
|
2113
2143
|
class TranscriptSpeakerNamed(_Base):
|
|
@@ -41,6 +41,7 @@ from .resources import (
|
|
|
41
41
|
Rtmp,
|
|
42
42
|
Search,
|
|
43
43
|
ShareLinks,
|
|
44
|
+
Speakers,
|
|
44
45
|
Tags,
|
|
45
46
|
Transcriptions,
|
|
46
47
|
Voices,
|
|
@@ -88,6 +89,7 @@ class VocalStack:
|
|
|
88
89
|
self.corrections = Corrections(t)
|
|
89
90
|
self.share_links = ShareLinks(t)
|
|
90
91
|
self.tags = Tags(t)
|
|
92
|
+
self.speakers = Speakers(t)
|
|
91
93
|
self.voices = Voices(t)
|
|
92
94
|
self.search = Search(t)
|
|
93
95
|
self.me = Me(t)
|
|
@@ -150,6 +150,9 @@ class _ParentResource(_Group):
|
|
|
150
150
|
async def list_share_links(self, id: str) -> List[m.ShareLink]:
|
|
151
151
|
return _many(m.ShareLink, await self._t.json("GET", self._path(id, "/share-links")), "links")
|
|
152
152
|
|
|
153
|
+
async def list_scripts(self, id: str) -> List[m.Script]:
|
|
154
|
+
return _many(m.Script, await self._t.json("GET", self._path(id, "/scripts")), "scripts")
|
|
155
|
+
|
|
153
156
|
async def create_share_link(self, id: str, **fields: Any) -> m.ShareLink:
|
|
154
157
|
body = _body(m.CreateShareLink, fields)
|
|
155
158
|
return _one(m.ShareLink, await self._t.json("POST", self._path(id, "/share-links"), json_body=body))
|
|
@@ -348,6 +351,11 @@ class Transcriptions(_ParentResource):
|
|
|
348
351
|
data = await self._t.json("DELETE", self._path(id, f"/broadcasts/{_p(broadcast_id)}"))
|
|
349
352
|
return _one(m.Transcription, data)
|
|
350
353
|
|
|
354
|
+
async def name_appearance(self, id: str, appearance: int, name: Optional[str]) -> None:
|
|
355
|
+
"""Name one speaker of the transcription: ``appearance`` is their
|
|
356
|
+
display number ("Speaker <number>"); ``None`` clears the name."""
|
|
357
|
+
await self._t.json("PUT", self._path(id, f"/appearances/{appearance}"), json_body={"name": name})
|
|
358
|
+
|
|
351
359
|
|
|
352
360
|
class Recordings(_Group):
|
|
353
361
|
"""``vs.recordings``: one take, live or uploaded."""
|
|
@@ -556,9 +564,6 @@ class Recordings(_Group):
|
|
|
556
564
|
async def media_token(self, id: str) -> Dict[str, Any]:
|
|
557
565
|
return await self._t.json("GET", self._path(id, "/media-token"))
|
|
558
566
|
|
|
559
|
-
async def name_speaker(self, id: str, speaker: int, name: Optional[str]) -> None:
|
|
560
|
-
await self._t.json("PUT", self._path(id, f"/speakers/{speaker}"), json_body={"name": name})
|
|
561
|
-
|
|
562
567
|
async def events(self, id: str, *, after: Optional[int] = None, limit: Optional[int] = None) -> List[m.RecordingEvent]:
|
|
563
568
|
"""The durable event log with wall times (owner only): every event
|
|
564
569
|
after ``after`` (a ``seq``; the whole log without it), read ``limit`` a page."""
|
|
@@ -724,29 +729,61 @@ class Tags(_Group):
|
|
|
724
729
|
|
|
725
730
|
|
|
726
731
|
class Voices(_Group):
|
|
727
|
-
"""``vs.voices``: the
|
|
732
|
+
"""``vs.voices``: the voices a language offers, and how each sounds."""
|
|
728
733
|
|
|
729
|
-
async def
|
|
730
|
-
|
|
734
|
+
async def available(
|
|
735
|
+
self,
|
|
736
|
+
lang: str,
|
|
737
|
+
*,
|
|
738
|
+
recording: Optional[str] = None,
|
|
739
|
+
listener_token: Optional[str] = None,
|
|
740
|
+
share_code: Optional[str] = None,
|
|
741
|
+
as_owner: bool = True,
|
|
742
|
+
) -> m.VoiceCatalogue:
|
|
743
|
+
"""The voices that can speak ``lang``, best first (with a token, also
|
|
744
|
+
the account's ready clones). ``recording`` also offers the cloned
|
|
745
|
+
voices that recording uses, to whoever may read it: its owner, or a
|
|
746
|
+
listener with ``listener_token`` or ``share_code``."""
|
|
747
|
+
data = await self._t.json(
|
|
748
|
+
"GET",
|
|
749
|
+
"/v1/voices/available",
|
|
750
|
+
query={**listener_query(listener_token, share_code), "lang": lang, "recording": recording},
|
|
751
|
+
anonymous=not as_owner,
|
|
752
|
+
)
|
|
753
|
+
return _one(m.VoiceCatalogue, data)
|
|
731
754
|
|
|
732
|
-
async def
|
|
733
|
-
|
|
755
|
+
async def preview(self, voice: str, lang: str, *, format: Optional[str] = None) -> bytes:
|
|
756
|
+
resp = await self._t.raw(
|
|
757
|
+
"GET", "/v1/voices/preview", headers={"accept": "*/*"}, query={"voice": voice, "lang": lang, "format": format}
|
|
758
|
+
)
|
|
759
|
+
return resp.content
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
class Speakers(_Group):
|
|
763
|
+
"""``vs.speakers``: the account's saved speakers, each with an optional
|
|
764
|
+
cloned voice (``voice``) built from their sample."""
|
|
765
|
+
|
|
766
|
+
async def list(self, *, lifecycle: Optional[str] = None) -> List[m.Speaker]:
|
|
767
|
+
return _many(m.Speaker, await self._t.json("GET", "/v1/speakers", query={"lifecycle": lifecycle}), "speakers")
|
|
734
768
|
|
|
735
|
-
async def
|
|
736
|
-
|
|
737
|
-
return _one(m.Voice, await self._t.json("POST", f"/v1/voices/{_p(id)}/archive"))
|
|
769
|
+
async def get(self, id: str) -> m.Speaker:
|
|
770
|
+
return _one(m.Speaker, await self._t.json("GET", f"/v1/speakers/{_p(id)}"))
|
|
738
771
|
|
|
739
|
-
async def
|
|
740
|
-
|
|
772
|
+
async def archive(self, id: str) -> m.Speaker:
|
|
773
|
+
"""Put a speaker away: their voice stops speaking and they are unlinked from their appearances."""
|
|
774
|
+
return _one(m.Speaker, await self._t.json("POST", f"/v1/speakers/{_p(id)}/archive"))
|
|
775
|
+
|
|
776
|
+
async def restore(self, id: str) -> m.Speaker:
|
|
777
|
+
return _one(m.Speaker, await self._t.json("POST", f"/v1/speakers/{_p(id)}/restore"))
|
|
741
778
|
|
|
742
779
|
async def archive_many(self, ids: List[str]) -> m.ManyResult:
|
|
743
|
-
return _one(m.ManyResult, await self._t.json("POST", "/v1/
|
|
780
|
+
return _one(m.ManyResult, await self._t.json("POST", "/v1/speakers/archive", json_body={"ids": ids}))
|
|
744
781
|
|
|
745
782
|
async def restore_many(self, ids: List[str]) -> m.ManyResult:
|
|
746
|
-
return _one(m.ManyResult, await self._t.json("POST", "/v1/
|
|
783
|
+
return _one(m.ManyResult, await self._t.json("POST", "/v1/speakers/restore", json_body={"ids": ids}))
|
|
747
784
|
|
|
748
785
|
async def delete_many(self, ids: List[str]) -> m.ManyResult:
|
|
749
|
-
return _one(m.ManyResult, await self._t.json("POST", "/v1/
|
|
786
|
+
return _one(m.ManyResult, await self._t.json("POST", "/v1/speakers/delete", json_body={"ids": ids}))
|
|
750
787
|
|
|
751
788
|
async def create(
|
|
752
789
|
self,
|
|
@@ -757,76 +794,75 @@ class Voices(_Group):
|
|
|
757
794
|
file_name: Optional[str] = None,
|
|
758
795
|
gender: Optional[str] = None,
|
|
759
796
|
color: Optional[str] = None,
|
|
760
|
-
draft: bool =
|
|
797
|
+
draft: Optional[bool] = None,
|
|
798
|
+
consent: Optional[bool] = None,
|
|
761
799
|
idempotency_key: Optional[str] = None,
|
|
762
|
-
) -> m.
|
|
763
|
-
"""
|
|
764
|
-
|
|
800
|
+
) -> m.Speaker:
|
|
801
|
+
"""Save a speaker from a sample or a link. Without ``consent`` they are
|
|
802
|
+
recognised only (``voice`` is ``None``); ``consent=True`` asserts you
|
|
803
|
+
have their permission and starts training their cloned voice."""
|
|
765
804
|
meta = _body(
|
|
766
|
-
m.
|
|
767
|
-
{"name": name, "sample_url": sample_url, "gender": gender, "color": color, "draft": draft
|
|
805
|
+
m.CreateSpeaker,
|
|
806
|
+
{"name": name, "sample_url": sample_url, "gender": gender, "color": color, "draft": draft, "consent": consent},
|
|
768
807
|
)
|
|
769
808
|
files: Dict[str, Any] = {"meta": (None, json.dumps(meta), "application/json")}
|
|
770
809
|
if sample is not None:
|
|
771
810
|
files["sample"] = await asyncio.to_thread(_file_part, sample, file_name, "sample.webm")
|
|
772
|
-
data = await self._t.json("POST", "/v1/
|
|
773
|
-
return _one(m.
|
|
774
|
-
|
|
775
|
-
async def
|
|
776
|
-
self,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
811
|
+
data = await self._t.json("POST", "/v1/speakers", files=files, idempotency_key=idempotency_key)
|
|
812
|
+
return _one(m.Speaker, data)
|
|
813
|
+
|
|
814
|
+
async def create_from_appearance(
|
|
815
|
+
self,
|
|
816
|
+
*,
|
|
817
|
+
transcription_id: str,
|
|
818
|
+
appearance: int,
|
|
819
|
+
name: str,
|
|
820
|
+
recording_id: Optional[str] = None,
|
|
821
|
+
color: Optional[str] = None,
|
|
822
|
+
consent: Optional[bool] = None,
|
|
823
|
+
spans: Optional[List[Dict[str, float]]] = None,
|
|
824
|
+
draft: Optional[bool] = None,
|
|
825
|
+
library: Optional[bool] = None,
|
|
826
|
+
idempotency_key: Optional[str] = None,
|
|
827
|
+
) -> m.Speaker:
|
|
828
|
+
"""Save a speaker from one appearance of a transcription (``appearance``
|
|
829
|
+
is the ``speaker`` index of their lines). ``consent=True`` asserts
|
|
830
|
+
permission and clones their voice; ``library=False`` keeps them with
|
|
831
|
+
that transcription only."""
|
|
780
832
|
body = _body(
|
|
781
|
-
m.
|
|
782
|
-
{
|
|
833
|
+
m.CreateSpeakerFromAppearance,
|
|
834
|
+
{
|
|
835
|
+
"transcription_id": transcription_id,
|
|
836
|
+
"recording_id": recording_id,
|
|
837
|
+
"appearance": appearance,
|
|
838
|
+
"name": name,
|
|
839
|
+
"color": color,
|
|
840
|
+
"consent": consent,
|
|
841
|
+
"spans": spans,
|
|
842
|
+
"draft": draft,
|
|
843
|
+
"library": library,
|
|
844
|
+
},
|
|
783
845
|
)
|
|
784
|
-
data = await self._t.json("POST", "/v1/
|
|
785
|
-
return _one(m.
|
|
846
|
+
data = await self._t.json("POST", "/v1/speakers/from-appearance", json_body=body, idempotency_key=idempotency_key)
|
|
847
|
+
return _one(m.Speaker, data)
|
|
786
848
|
|
|
787
|
-
async def set_consent(self, id: str, consent: str, *, name: Optional[str] = None) -> m.
|
|
849
|
+
async def set_consent(self, id: str, consent: str, *, name: Optional[str] = None) -> m.Speaker:
|
|
788
850
|
"""Record whether the speaker agreed to their clone: ``granted`` (with an
|
|
789
|
-
optional name
|
|
790
|
-
|
|
791
|
-
``pending``."""
|
|
851
|
+
optional name) makes their voice speak; ``refused`` deletes its audio
|
|
852
|
+
and voice. Automatic clones start ``pending``."""
|
|
792
853
|
body = _body(m.SetConsent, {"consent": consent, "name": name})
|
|
793
|
-
return _one(m.
|
|
854
|
+
return _one(m.Speaker, await self._t.json("POST", f"/v1/speakers/{_p(id)}/consent", json_body=body))
|
|
794
855
|
|
|
795
|
-
async def update(self, id: str, **fields: Any) -> m.
|
|
796
|
-
|
|
797
|
-
|
|
856
|
+
async def update(self, id: str, **fields: Any) -> m.Speaker:
|
|
857
|
+
"""Rename or recolour; ``enabled`` turns the cloned voice on or off;
|
|
858
|
+
``consent=True`` on a speaker without a clone starts one from their sample."""
|
|
859
|
+
body = _body(m.PatchSpeaker, fields)
|
|
860
|
+
return _one(m.Speaker, await self._t.json("PATCH", f"/v1/speakers/{_p(id)}", json_body=body))
|
|
798
861
|
|
|
799
862
|
async def delete(self, id: str) -> None:
|
|
800
|
-
await self._t.json("DELETE", f"/v1/
|
|
801
|
-
|
|
802
|
-
async def available(
|
|
803
|
-
self,
|
|
804
|
-
lang: str,
|
|
805
|
-
*,
|
|
806
|
-
recording: Optional[str] = None,
|
|
807
|
-
listener_token: Optional[str] = None,
|
|
808
|
-
share_code: Optional[str] = None,
|
|
809
|
-
as_owner: bool = True,
|
|
810
|
-
) -> m.VoiceCatalogue:
|
|
811
|
-
"""The voices that can speak ``lang``, best first (with a token, also
|
|
812
|
-
the account's ready clones). ``recording`` also offers the cloned
|
|
813
|
-
voices that recording uses, to whoever may read it: its owner, or a
|
|
814
|
-
listener with ``listener_token`` or ``share_code``."""
|
|
815
|
-
data = await self._t.json(
|
|
816
|
-
"GET",
|
|
817
|
-
"/v1/voices/available",
|
|
818
|
-
query={**listener_query(listener_token, share_code), "lang": lang, "recording": recording},
|
|
819
|
-
anonymous=not as_owner,
|
|
820
|
-
)
|
|
821
|
-
return _one(m.VoiceCatalogue, data)
|
|
822
|
-
|
|
823
|
-
async def preview(self, voice: str, lang: str, *, format: Optional[str] = None) -> bytes:
|
|
824
|
-
resp = await self._t.raw(
|
|
825
|
-
"GET", "/v1/voices/preview", headers={"accept": "*/*"}, query={"voice": voice, "lang": lang, "format": format}
|
|
826
|
-
)
|
|
827
|
-
return resp.content
|
|
863
|
+
await self._t.json("DELETE", f"/v1/speakers/{_p(id)}")
|
|
828
864
|
|
|
829
|
-
async def
|
|
865
|
+
async def voice_preview(
|
|
830
866
|
self,
|
|
831
867
|
id: str,
|
|
832
868
|
*,
|
|
@@ -837,12 +873,12 @@ class Voices(_Group):
|
|
|
837
873
|
share_code: Optional[str] = None,
|
|
838
874
|
as_owner: bool = True,
|
|
839
875
|
) -> bytes:
|
|
840
|
-
"""
|
|
841
|
-
in that recording, for whoever may read it (its owner, or a
|
|
842
|
-
with ``listener_token`` or ``share_code``)."""
|
|
876
|
+
"""The speaker's cloned voice speaking ``lang``. With ``recording``, as
|
|
877
|
+
it speaks in that recording, for whoever may read it (its owner, or a
|
|
878
|
+
listener with ``listener_token`` or ``share_code``)."""
|
|
843
879
|
resp = await self._t.raw(
|
|
844
880
|
"GET",
|
|
845
|
-
f"/v1/
|
|
881
|
+
f"/v1/speakers/{_p(id)}/preview",
|
|
846
882
|
headers={"accept": "*/*"},
|
|
847
883
|
query={**listener_query(listener_token, share_code), "lang": lang, "format": format, "recording": recording},
|
|
848
884
|
anonymous=not as_owner,
|
|
@@ -850,7 +886,7 @@ class Voices(_Group):
|
|
|
850
886
|
return resp.content
|
|
851
887
|
|
|
852
888
|
async def sample(self, id: str) -> bytes:
|
|
853
|
-
resp = await self._t.raw("GET", f"/v1/
|
|
889
|
+
resp = await self._t.raw("GET", f"/v1/speakers/{_p(id)}/sample", headers={"accept": "*/*"})
|
|
854
890
|
return resp.content
|
|
855
891
|
|
|
856
892
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|