aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/speechrecognitionalternative/transcript
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/speechrecognitionalternative/transcript
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/speechrecognitionalternative/transcript')
-rw-r--r--files/ja/web/api/speechrecognitionalternative/transcript/index.html97
1 files changed, 97 insertions, 0 deletions
diff --git a/files/ja/web/api/speechrecognitionalternative/transcript/index.html b/files/ja/web/api/speechrecognitionalternative/transcript/index.html
new file mode 100644
index 0000000000..6eb8c3d932
--- /dev/null
+++ b/files/ja/web/api/speechrecognitionalternative/transcript/index.html
@@ -0,0 +1,97 @@
+---
+title: SpeechRecognitionAlternative.transcript
+slug: Web/API/SpeechRecognitionAlternative/transcript
+tags:
+ - API
+ - Experimental
+ - Property
+ - Reference
+ - SpeechRecognitionAlternative
+ - Web Speech API
+ - recognition
+ - speech
+ - transcript
+translation_of: Web/API/SpeechRecognitionAlternative/transcript
+---
+<p>{{APIRef("Web Speech API")}}{{ SeeCompatTable() }}</p>
+
+<p>{{domxref("SpeechRecognitionResult")}} インターフェースの <code><strong>transcript</strong></code> 読み取り専用プロパティは、認識したワードの記録を含む文字列を返します。</p>
+
+<p>連続認識において、連続した {{domxref("SpeechRecognitionResult")}} の連結がセッションの適切な記録を生成するように、必要に応じて先頭または末尾の空白が含まれます。</p>
+
+<h2 id="構文">構文</h2>
+
+<pre class="syntaxbox">var myTranscript = speechRecognitionAlternativeInstance.transcript;</pre>
+
+<h3 id="戻り値">戻り値</h3>
+
+<p>{{domxref("DOMString")}}。</p>
+
+<h2 id="例">例</h2>
+
+<p>このコードは、<a href="https://github.com/mdn/web-speech-api/blob/master/speech-color-changer/script.js">Speech color changer</a> から抜き出しています。</p>
+
+<pre class="brush: js">recognition.onresult = function(event) {
+  // The SpeechRecognitionEvent results property returns a SpeechRecognitionResultList object
+  // The SpeechRecognitionResultList object contains SpeechRecognitionResult objects.
+  // It has a getter so it can be accessed like an array
+  // The first [0] returns the SpeechRecognitionResult at position 0.
+  // Each SpeechRecognitionResult object contains SpeechRecognitionAlternative objects that contain individual results.
+  // These also have getters so they can be accessed like arrays.
+  // The second [0] returns the SpeechRecognitionAlternative at position 0.
+  // We then return the transcript property of the SpeechRecognitionAlternative object
+  var color = event.results[0][0].transcript;
+  diagnostic.textContent = 'Result received: ' + color + '.';
+  bg.style.backgroundColor = color;
+}</pre>
+
+<h2 id="仕様">仕様</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">仕様</th>
+ <th scope="col">ステータス</th>
+ <th scope="col">コメント</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Web Speech API', '#dfn-transcript', 'transcript')}}</td>
+ <td>{{Spec2('Web Speech API')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="ブラウザー実装状況">ブラウザー実装状況</h2>
+
+
+
+<p>{{Compat("api.SpeechRecognitionAlternative.transcript")}}</p>
+
+<ul>
+ <li>[1] Chrome では、SpeechRecognitionare インターフェースにプレフィックスが必要です。そのため、インターフェース名に <code>webkitSpeechRecognition</code> のようなプレフィックスが必要です; また、認識を動作させるには、Web サーバ上から提供する必要があります。</li>
+ <li>[2] <a>about:config</a> の <code>media.webspeech.recognition.enable</code> フラグで有効にできますが、現在の音声認識はデスクトップ版の Firefox では機能しません - 必要な内部権限が整理されればすぐに適切に公開されます。</li>
+</ul>
+
+<h3 id="Firefox_OS_許可">Firefox OS 許可</h3>
+
+<p>アプリで音声認識を使用するには、<a href="/ja/docs/Web/Apps/Build/Manifest">manifest</a> で次の許可が必要です:</p>
+
+<pre class="brush: json">"permissions": {
+ "audio-capture" : {
+ "description" : "Audio capture"
+ },
+ "speech-recognition" : {
+ "description" : "Speech recognition"
+ }
+}</pre>
+
+<p>特権アプリも必要なため、次のものも含める必要があります。</p>
+
+<pre class="brush: json"> "type": "privileged"</pre>
+
+<h2 id="関連項目">関連項目</h2>
+
+<ul>
+ <li><a href="/ja/docs/Web/API/Web_Speech_API">Web Speech API</a></li>
+</ul>