summaryrefslogtreecommitdiffstats
path: root/dom/media/webspeech
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/webspeech
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webspeech')
-rw-r--r--dom/media/webspeech/recognition/SpeechRecognition.cpp13
-rw-r--r--dom/media/webspeech/synth/nsISynthVoiceRegistry.idl12
2 files changed, 7 insertions, 18 deletions
diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp
index 75d1ba7709..7239a88237 100644
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -437,12 +437,13 @@ uint32_t SpeechRecognition::ProcessAudioSegment(AudioSegment* aSegment,
// we need to call the nsISpeechRecognitionService::ProcessAudioSegment
// in a separate thread so that any eventual encoding or pre-processing
// of the audio does not block the main thread
- nsresult rv = mEncodeTaskQueue->Dispatch(
- NewRunnableMethod<StoreCopyPassByPtr<AudioSegment>, TrackRate>(
- "nsISpeechRecognitionService::ProcessAudioSegment",
- mRecognitionService,
- &nsISpeechRecognitionService::ProcessAudioSegment,
- std::move(*aSegment), aTrackRate));
+ nsresult rv = mEncodeTaskQueue->Dispatch(NS_NewRunnableFunction(
+ "nsISpeechRecognitionService::ProcessAudioSegment",
+ [=, service = mRecognitionService,
+ segment = std::move(*aSegment)]() mutable {
+ service->ProcessAudioSegment(&segment, aTrackRate);
+ }));
+
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
Unused << rv;
return samples;
diff --git a/dom/media/webspeech/synth/nsISynthVoiceRegistry.idl b/dom/media/webspeech/synth/nsISynthVoiceRegistry.idl
index 1898bf68c1..8192eff045 100644
--- a/dom/media/webspeech/synth/nsISynthVoiceRegistry.idl
+++ b/dom/media/webspeech/synth/nsISynthVoiceRegistry.idl
@@ -65,18 +65,6 @@ interface nsISynthVoiceRegistry : nsISupports
};
%{C++
-#define NS_SYNTHVOICEREGISTRY_CID \
- { /* {7090524d-5574-4492-a77f-d8d558ced59d} */ \
- 0x7090524d, \
- 0x5574, \
- 0x4492, \
- { 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \
- }
-
#define NS_SYNTHVOICEREGISTRY_CONTRACTID \
"@mozilla.org/synth-voice-registry;1"
-
-#define NS_SYNTHVOICEREGISTRY_CLASSNAME \
- "Speech Synthesis Voice Registry"
-
%}