Spaces:
Sleeping
Sleeping
add http call demo
Browse filesSigned-off-by: 明扬 <[email protected]>
- http-client.env.json +5 -0
- student.http +12 -0
- teacher.http +11 -0
http-client.env.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"demo": {
|
3 |
+
"exampleServer": "mingyang91-polyhedron.hf.space"
|
4 |
+
}
|
5 |
+
}
|
student.http
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### student API
|
2 |
+
// IN message: N/A
|
3 |
+
// - id: [Required], course ID
|
4 |
+
// - language: [Required], zh-CN, en-US
|
5 |
+
// - voice: [Required], Takumi
|
6 |
+
// *language & voice support matrix*: https://docs.aws.amazon.com/zh_cn/polly/latest/dg/voicelist.html
|
7 |
+
// OUT message:
|
8 |
+
// example1: {"type":"original","content":"哎,","isFinal":true}
|
9 |
+
// example2: {"type":"translated","content":"ねえ、"}
|
10 |
+
// example3: {"type":"lipSync","visemes":[{"time":12,"value":"t"},{"time":25,"value":"@"},{"time":200,"value":"sil"}]}
|
11 |
+
// example4: Binary data, PCM audio, 16K sampling rate, single channel, 16-bit depth, little endian
|
12 |
+
WEBSOCKET wss://{{$exampleServer}}}/ws/student?id=456&language=zh-CN&voice=Takumi
|
teacher.http
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### teacher API
|
2 |
+
// ONLY SUPPORT SINGLE TEACHER PER COURSE ID
|
3 |
+
// IN message:
|
4 |
+
// Binary data, PCM audio, 16K sampling rate, single channel, 16-bit depth, little endian
|
5 |
+
// id: [Required], course ID
|
6 |
+
// language: [Required], zh-CN, en-US... (see https://docs.aws.amazon.com/zh_cn/transcribe/latest/dg/supported-languages.html)
|
7 |
+
// prompt: [Optional], All background and context about the course topic
|
8 |
+
// OUT message:
|
9 |
+
// example1: {"type":"original","content":"之后","isFinal":false}
|
10 |
+
// example2: {"type":"original","content":"之后的资本就是说做的工作的做的东西","isFinal":true}
|
11 |
+
WEBSOCKET wss://{{$exampleServer}}}/ws/teacher?id=456&language=zh-CN&prompt=
|