Comments (23)
Hi,
We provide C++ libraries for Snowboy, so it's definitely possible to use Snowboy in swift. You can search for instructions of how to use C++ libraries in swift. For example, this page http://www.swiftprogrammer.info/swift_call_cpp.html. Basically you will have to write some simple wrappers for the C++ library.
Typically we use swig to generate wrappers for different programing languages. But swig probably doesn't support swift yet. In this case you may have to write the wrapper by yourself but it shouldn't be very complicated anyway. I'll post some examples of how to use Snowboy in C++ today (see #4), which might be helpful.
We would really appreciate it if you could help us looking into this direction, and possibly submit a pull request for your wrappers. Would like to see Snowboy in MacLexa, and we are ready to help if you have any questions!
Guoguo
from snowboy.
@kunal732 C++ example added: #7
Do you need extra help from here with the swift interface?
from snowboy.
I'm interested in building into an obj-c app that seems more doable yea?
from snowboy.
@flooie, that should be very easy. You can use the library under lib/ios/libsnowboy-detect.a (yes that's a fat library) and follow the C++ examples. It's basically same as using C++ library in Obj-C
from snowboy.
@chenguoguo I've taken a couple cracks at it - to no avail. Totally on my end. Any chance you have a good resource you can point me to online?
from snowboy.
@chenguoguo I also showed off snowboy to a cocoa heads boston last night.
from snowboy.
That's interesting. Did it work well in meetings? With Siri coming to the
Mac, it's more interesting we give people another choice in both trigger
word and the service behind it (AVS)
On Jun 10, 2016 6:33 AM, "flooie" [email protected] wrote:
@chenguoguo https://github.com/chenguoguo I also showed off snowboy to
a cocoa heads boston last night.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAhLO9YMkKBcn1AH3MuOz85UsQKvfwT-ks5qKWe-gaJpZM4IkHyy
.
from snowboy.
@flooie I felt it might be easier to give you an example, so I created this repo. I basically took Apple's aurioTouch sample code and modified it to have Snowboy hotword detection. You can compare the master branch and the snowboy branch to see what changes I have made to make it work. I mostly modified the file Classes/AudioController.mm. You should be able to run it from simulator.
Note that this setup is not optimized for hotword detection. And feel free to switch to other audio capturing tools if you have a preference. Let me know if you need more information on this.
from snowboy.
@chenguoguo this was helpful and validates what I was doing but I've mirrored (almost ) the project settings and can't get beyond this.
I'm using the compiled library in the OS X folder of the download.... any thoughts?
Undefined symbols for architecture x86_64:
"snowboy::SnowboyDetect::SnowboyDetect()", referenced from:
-[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from snowboy.
thanks btw- you've gone above and beyond for me
from snowboy.
@flooie I think I've seen this yesterday. It was related to Xcode setting in my case. Initially I tried to add snowboy-detect.h and libsnowboy-detect.a through the 'Add Files to "auroiTouch"' option (which you can find through right click) and I think that error appeared. I then tried to create a directory called snowboy through the "New Group" option, and added snowboy-detect.h and libsnowboy-detect.a to that directory. I also changed the type of snowboy-detect.h to "C++ header" (through identity and type), location to "Relative to Group". For libsnowboy-detect.a I used type "Default - Data" and location "Relative to Group". That fixed the issue for me.
BTW, if you checkout out my repo (snowboy branch) and open the project directly, does it work for you? It works on my end.
from snowboy.
@flooie just saw this "I'm using the compiled library in the OS X folder of the download.... any thoughts?" Can you try to use the compiled library in the iOS folder? The library under the iOS folder is a fat library and contains library for x86_64 as well.
from snowboy.
@chenguoguo - I did check out the project and it does work on my computer. so i modeled everything based on that but haven't been able to get the OS X version to work.
from snowboy.
@flooie I suspect it's a configuration problem. Are you using Xcode to build your project? I tried to replace the iOS library with the OS X library in my example and it worked as well. So I think the library itself should be OK. Let us know if you get any progress on this.
from snowboy.
I am using Xcode and I thought I mirrored the settings pretty well - minus the iOS to OS X situation. - I'm gonna take another crack at it right now.
from snowboy.
I think I have success-
from snowboy.
Could you briefly let us know how you fix it?
from snowboy.
This info was not generated by the Snowboy library itself right? If you
feel there's too much of this kind of info, you can try to send the info
only when there's a status change.
Generally I would call the RunDetection() function every 0.01~0.1 second.
That's something you can play with. Higher frequency will lead to less
detection latency but also higher CPU usage. You can control this by using
some kind of sleep function. For example, in the Python demo we sleep for
0.03 second between each RunDetection() call.
On Sun, Jun 12, 2016 at 11:58 PM, flooie [email protected] wrote:
I'll happily share my code when I get it finished .
Now Ive got everything working and I'm detecting and sending information -
but I can't get beyond this2016-06-12 11:56:32.251 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.263 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.274 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.286 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.297 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.309 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.321 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.332 Objcplusplus[26728:5473805] the result is 0
2016-06-12 11:56:32.345 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.355 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.366 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.378 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.390 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.401 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.413 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.425 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.436 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.448 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.459 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.471 Objcplusplus[26728:5473805] the result is -2
2016-06-12 11:56:32.483 Objcplusplus[26728:5473805] the result is -2How fast should the loop be?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#5 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ALPfk2GbXd1iVH2h4gfbsoT4za3ygxKJks5qLCy0gaJpZM4IkHyy
.
from snowboy.
@chenguoguo mind if I share with you the project and you can take a gander?
from snowboy.
@flooie sure i can have a look
from snowboy.
@chenguoguo repo thanks -
from snowboy.
@flooie I cloned your repo and tried to build it with xcode, but I got the following error. What should I do to set up EZAudio properly? Or is it possible to set everything up in your repo?
ld: warning: directory not found for option '-L/Users/guoguo/Library/Developer/Xcode/DerivedData/Objcplusplus-ckypuogsetkktxggcfdknkvgjalc/Build/Products/Debug/EZAudio'
ld: warning: directory not found for option '-L/Users/guoguo/Library/Developer/Xcode/DerivedData/Objcplusplus-ckypuogsetkktxggcfdknkvgjalc/Build/Products/Debug/TPCircularBuffer'
ld: library not found for -lEZAudio
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from snowboy.
@chenguoguo Use Objcplusplus.xcworkspace - not xcodeproj
from snowboy.
Related Issues (20)
- I run demo on my device,I got a crash
- cant patch avs-kittai.patch to pi.sh and setup.sh HOT 2
- 安装到最后后端进不去 HOT 1
- snowboy issue HOT 1
- support for arm64 ubuntu 20.04 ? HOT 1
- issues while rebuilding snowboy on MMM-awesome-alexa
- /node_modules/.bin/electron-rebuild fails with weird errors
- Website down? HOT 1
- Make it available for windows!!!!!!! HOT 1
- Depencies not updated in documentation for latest Ubuntu versions.
- snowboy不支持 rsicv 架构 HOT 1
- Did you change `examples/Python/snowboydetect.py` by any chance? That file was generated by swig automatically and the first line is not `../../swig/Python/snowboydetect.py`. Your error message seems to suggest that the first line is `../../swig/Python/snowboydetect.py` HOT 2
- make -C arch64-ubuntu1604 libsnowboy-detect.a make[1]: *** arch64-ubuntu1604: No such file or directory. Stop. make: *** [Makefile:67: arch64-ubuntu1604/libsnowboy-detect.a] Error 2
- 不知道啥原因
- ../..//lib/ubuntu64/libsnowboy-detect.a : error adding symbols: file format not recognized
- makefile有问题 HOT 7
- met some issues when tring to insert wake words in snowboy HOT 1
- met some bug when tring to insert wake words in snowboy
- more undefined references to `std::istream::seekg(std::fpos<mbstate_t>)' follow
- Socialismo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snowboy.