Giter Club home page Giter Club logo

Comments (23)

chenguoguo avatar chenguoguo commented on June 27, 2024

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.

xuchen avatar xuchen commented on June 27, 2024

@kunal732 C++ example added: #7

Do you need extra help from here with the swift interface?

from snowboy.

flooie avatar flooie commented on June 27, 2024

I'm interested in building into an obj-c app that seems more doable yea?

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

@chenguoguo I also showed off snowboy to a cocoa heads boston last night.

from snowboy.

xuchen avatar xuchen commented on June 27, 2024

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.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

thanks btw- you've gone above and beyond for me

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

@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.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

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.

flooie avatar flooie commented on June 27, 2024

I think I have success-

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

Could you briefly let us know how you fix it?

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

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 this

2016-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 -2

How 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.

flooie avatar flooie commented on June 27, 2024

@chenguoguo mind if I share with you the project and you can take a gander?

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@flooie sure i can have a look

from snowboy.

flooie avatar flooie commented on June 27, 2024

@chenguoguo repo thanks -

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@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.

flooie avatar flooie commented on June 27, 2024

@chenguoguo Use Objcplusplus.xcworkspace - not xcodeproj

from snowboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.