-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate this library into an OSX app with xcode #5
Comments
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 |
I'm interested in building into an obj-c app that seems more doable yea? |
@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 |
@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? |
@chenguoguo I also showed off snowboy to a cocoa heads boston last night. |
That's interesting. Did it work well in meetings? With Siri coming to the
|
@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. |
@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: |
thanks btw- you've gone above and beyond for me |
@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. |
@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. |
@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. |
@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. |
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. |
I think I have success- |
Could you briefly let us know how you fix it? |
This info was not generated by the Snowboy library itself right? If you Generally I would call the RunDetection() function every 0.01~0.1 second. On Sun, Jun 12, 2016 at 11:58 PM, flooie [email protected] wrote:
|
@chenguoguo mind if I share with you the project and you can take a gander? |
@flooie sure i can have a look |
@chenguoguo repo thanks - |
@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?
|
@chenguoguo Use Objcplusplus.xcworkspace - not xcodeproj |
Would love to incorporate this in a project im working on https://github.com/kunal732/MacLexa. Would it be possible to incorporate this into a swift mac app ?
The text was updated successfully, but these errors were encountered: