Reputation: 6497
I am using webkitSpeechRecognition
instance to access the native speech recognition in Chrome. The problem is that the Web Speech API specification does not cover the topic of profanity filtering, yet Google's Speech API, by default, has the profanity filter enabled. It is not a major problem - luckily the default filter for Web Speech API shows the first letter and hides the rest under the asterisks. However there are cases when a word starting with a certain letter and having a certain length be derived from different cuss words and guessing what the person has said may not give an accurate result.
The question here is: how can the profanity filtering level of Web Speech API in Chrome be controlled? The JavaScript instance does not expose any additional (platform specific) variables to play around with. The actual Speech API had the pfilter
URL parameter which can be set to 0 (no filtering), 1 (filtering and replacing words with ####) or 2 (filtering and replacing all but the first letter with asterisks). This parameter is also exposed for Chrome Extension developers, it is located in SpeechInputStartOptions
(however it is a boolean variable).
P.S. The SpeechInputStartOptions documentation talks about default Chrome filtering settings. I could not find the setting for this or any information about where it is located. Even though ideally, the solution should not involve user having to do something, finding the in-Chrome setting for it would still be a breakthrough.
Upvotes: 26
Views: 3141
Reputation: 900
Currently, Chrome does not allow disabling the profanity filter on webkitSpeechRecognition
.
I was able to find these 2 bugs:
The Chromium source code does seem to have the option called filter_profanities
but seems to be defaulting it to true for the web version.
( In case you are interested, link to Chromium source for speech_recognition_session_config.h that defines filter_profanities
)
Closest working solution I could find was Google's Speech to text cloud solution which does allow removing the profanity filter.
Upvotes: 12