質問編集履歴

3

追記

2019/04/28 08:58

投稿

sequelanonymous
sequelanonymous

スコア123

test CHANGED
File without changes
test CHANGED
@@ -53,3 +53,17 @@
53
53
 
54
54
 
55
55
  上記文字化けは、logger.info(response)のresponseの中身になります。
56
+
57
+
58
+
59
+ - 追記
60
+
61
+ ```
62
+
63
+ config = types.RecognitionConfig(
64
+
65
+ encoding=enums.RecognitionConfig.AudioEncoding.FLAC,
66
+
67
+ language_code='ja-JP')
68
+
69
+ ```

2

修正

2019/04/28 08:58

投稿

sequelanonymous
sequelanonymous

スコア123

test CHANGED
File without changes
test CHANGED
@@ -32,11 +32,9 @@
32
32
 
33
33
  for uri in uris:
34
34
 
35
- if uri not in completed:
35
+ audio = types.RecognitionAudio(uri=uri)
36
36
 
37
- audio = types.RecognitionAudio(uri=uri)
38
-
39
- operations.append((uri, speech_client.long_running_recognize(config, audio)))
37
+ operations.append((uri, speech_client.long_running_recognize(config, audio)))
40
38
 
41
39
 
42
40
 
@@ -50,8 +48,6 @@
50
48
 
51
49
  results.extend(response)
52
50
 
53
- completed.add(uri)
54
-
55
51
  ```
56
52
 
57
53
 

1

追記

2019/04/26 21:14

投稿

sequelanonymous
sequelanonymous

スコア123

test CHANGED
File without changes
test CHANGED
@@ -19,3 +19,41 @@
19
19
  ]
20
20
 
21
21
  ```
22
+
23
+
24
+
25
+ 追記:
26
+
27
+ ```python
28
+
29
+ for i, uris in enumerate(uris_list):
30
+
31
+ operations = []
32
+
33
+ for uri in uris:
34
+
35
+ if uri not in completed:
36
+
37
+ audio = types.RecognitionAudio(uri=uri)
38
+
39
+ operations.append((uri, speech_client.long_running_recognize(config, audio)))
40
+
41
+
42
+
43
+ for index, operation in enumerate(operations):
44
+
45
+ uri = operation[0]
46
+
47
+ response = operation[1].result()
48
+
49
+ logger.info(response)
50
+
51
+ results.extend(response)
52
+
53
+ completed.add(uri)
54
+
55
+ ```
56
+
57
+
58
+
59
+ 上記文字化けは、logger.info(response)のresponseの中身になります。