Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit ec38970

Browse files
committed
Minor tweak to error handling. Recreated unitypackage.
1 parent d80eb06 commit ec38970

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

speechly-dotnet/Speechly/SpeechlyClient/OnDeviceDecoder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ override internal async Task Initialize(AudioProcessorOptions audioProcessorOpti
173173
try {
174174
bundle_buf = await this.modelBundleProvider();
175175
} catch (Exception e) {
176-
throw new Exception($"Failed to load Speechly on-device Model Bundle. Please check if the file exists.\n{e.Message}");
176+
throw new Exception($"Failed to load Speechly model bundle. Please check if the file exists.\n{e.Message}");
177177
}
178178

179-
if (bundle_buf.Length == 0) {
180-
throw new Exception($"Failed to load Speechly on-device Model Bundle. The file has zero length.\nAre you trying to load placeholder dummy.bundle? Please contact Speechly to enable on-device support.");
179+
if (bundle_buf == null || bundle_buf.Length == 0) {
180+
throw new Exception($"Could not load Speechly model bundle or it has zero length.\nAre you trying to load placeholder dummy.bundle? Please contact Speechly to enable on-device support.");
181181
}
182182

183183
decoderFactoryHandle = DecoderFactory_CreateFromModelArchive(bundle_buf, bundle_buf.Length, ref error);

speechly-unity/Assets/Speechly/SpeechlyClient/OnDeviceDecoder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ override internal async Task Initialize(AudioProcessorOptions audioProcessorOpti
173173
try {
174174
bundle_buf = await this.modelBundleProvider();
175175
} catch (Exception e) {
176-
throw new Exception($"Failed to load Speechly on-device Model Bundle. Please check if the file exists.\n{e.Message}");
176+
throw new Exception($"Failed to load Speechly model bundle. Please check if the file exists.\n{e.Message}");
177177
}
178178

179-
if (bundle_buf.Length == 0) {
180-
throw new Exception($"Failed to load Speechly on-device Model Bundle. The file has zero length.\nAre you trying to load placeholder dummy.bundle? Please contact Speechly to enable on-device support.");
179+
if (bundle_buf == null || bundle_buf.Length == 0) {
180+
throw new Exception($"Could not load Speechly model bundle or it has zero length.\nAre you trying to load placeholder dummy.bundle? Please contact Speechly to enable on-device support.");
181181
}
182182

183183
decoderFactoryHandle = DecoderFactory_CreateFromModelArchive(bundle_buf, bundle_buf.Length, ref error);

speechly.unitypackage

-136 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)