diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/speechrecognitionalternative | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/speechrecognitionalternative')
-rw-r--r-- | files/ja/web/api/speechrecognitionalternative/index.html | 93 | ||||
-rw-r--r-- | files/ja/web/api/speechrecognitionalternative/transcript/index.html | 97 |
2 files changed, 190 insertions, 0 deletions
diff --git a/files/ja/web/api/speechrecognitionalternative/index.html b/files/ja/web/api/speechrecognitionalternative/index.html new file mode 100644 index 0000000000..14421c1010 --- /dev/null +++ b/files/ja/web/api/speechrecognitionalternative/index.html @@ -0,0 +1,93 @@ +--- +title: SpeechRecognitionAlternative +slug: Web/API/SpeechRecognitionAlternative +tags: + - API + - Experimental + - Interface + - Reference + - SpeechRecognitionAlternative + - Web Speech API + - recognition + - speech +translation_of: Web/API/SpeechRecognitionAlternative +--- +<p>{{APIRef("Web Speech API")}}{{SeeCompatTable}}</p> + +<p><a href="/ja/docs/Web/API/Web_Speech_API">Web Speech API</a> の <strong><code>SpeechRecognitionAlternative</code></strong> インターフェイスは、音声認識サービスにより認識されている一つの単語を表します。</p> + +<h2 id="Properties" name="Properties">プロパティ</h2> + +<dl> + <dt>{{domxref("SpeechRecognitionAlternative.transcript")}} {{readonlyinline}}</dt> + <dd>認識された単語の transcript を含む文字列を返します。</dd> + <dt>{{domxref("SpeechRecognitionAlternative.confidence")}} {{readonlyinline}}</dt> + <dd>音声認識システムの認識の正しさの信頼度を表す評価を数値で返します。</dd> +</dl> + +<h2 id="Examples" name="Examples">例</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="Specifications" name="Specifications">仕様</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', '#speechreco-alternative', 'SpeechRecognitionAlternative')}}</td> + <td>{{Spec2('Web Speech API')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの実装状況</h2> + +<div> + + +<p>{{Compat("api.SpeechRecognitionAlternative")}}</p> +</div> + +<h3 id="Firefox_OS_permissions" name="Firefox_OS_permissions">Firefox OS の許可設定</h3> + +<p>アプリ内で音声認識を使用するには、<a href="/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="See_also" name="See_also">関連項目</h2> + +<ul> + <li><a href="/docs/Web/API/Web_Speech_API">Web Speech API</a></li> +</ul> 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> |