Open ayangweb opened 1 year ago
Can you create a Info.plist
file next to your tauri.conf.json file, similar to this: https://github.com/tauri-apps/tauri/blob/dev/examples/api/src-tauri/Info.plist with these contents
<key>NSMicrophoneUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
<key>NSCameraUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
Edit: Users on discord reported that this makes it work on macOS. Therefore i'm closing this issue.
@FabianLars, I have tried this solution but the app crashes immediately without any log
The exact src-tauri/Info.plist
content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSMicrophoneUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
<key>NSCameraUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>write some text describing the usage of the permission here</string>
</dict>
</plist>
@alimehasin Which macOS version are you using? I think it needs at least 11.3
@FabianLars, The issue happened on macOS v13.3
Alright i'll re-open this then until someone with a macos system can take a look.
@FabianLars @alimehasin I'm sorry for my late reply,The problem has been solved, thanks!
@ayangweb 兄弟,咋解决的啊。webkitSpeechRecognition
调用了就崩溃哦
webkitSpeechRecognition
mac 确实有这个问题,需要 debug 模式打包调试!
I have this issue on MacOS, even after adding the NSSpeechRecognitionUsageDescription
key - but only in development mode. If I do a full build, it works fine. This is on the 2.0 beta.
I can get crash reports and the report is simply that the NSSpeechRecognitionUsageDescription
key is not found in the Info.plist
. I guess it's something to do with the custom Info.plist
not being exposed to MacOS while in development.
EDIT: I figured out the cause of my issue, and maybe this is relevant for tons of other strange issues with permissions that people are having. It turns out that if I do pnpm tauri dev
through an integrated VSCode terminal (which I usually do) I will not be able to use speech recognition. If I do pnpm tauri dev
just in a normal terminal, I don't get the issue.
I get the problem when in development mode as well. whether I am in the terminal or not when I run bun run tauri dev
. I seem to have trouble when it is built too, unlike the above comment.
Using the latest Tauri, 1.6 (not 2.0 rcs yet) and on Macbook M2 with Sonoma 14.5
When I added the Info.plist file, it DID ask me permission to use the microphone, but then it failed. When I start recognition, I can see the microphone icon on my menu bar flicker on and then immediately off.
Using the inspector, I am told "Siri and Dictation are diabled"
This code seems to work fine in native Safari and Chrome on my Macbook.
Describe the bug
I'm using SpeechRecognition and I'm getting an error, the error is as shown in the picture, the code is fine in the browser but the error is reported in tauri, I guess it's a permission problem, should I get the audio permission? I hope you guys can give me some pointers!
a simple code snippet is attached below
Reproduction
No response
Expected behavior
No response
Platform and versions
Environment › OS: Mac OS 12.6.0 X64 › Node.js: 16.14.1 › npm: 8.19.3 › pnpm: 7.14.2 › yarn: 1.22.19 › rustup: 1.25.2 › rustc: 1.67.0 › cargo: 1.67.0 › Rust toolchain: stable-aarch64-apple-darwin
Packages › @tauri-apps/cli [NPM]: 1.2.3 › @tauri-apps/api [NPM]: 1.2.0 › tauri [RUST]: 1.2.4, › tauri-build [RUST]: 1.2.1, › tao [RUST]: 0.15.8, › wry [RUST]: 0.23.4,
Stack trace
No response
Additional context
No response