Skip to content
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

Ruby bindings and sample #403

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Ruby bindings and sample #403

wants to merge 13 commits into from

Conversation

ppibburr
Copy link

I made a ruby wrapper with FFI around the C portaudio example, using it as a sharedlib instead of a binary.

Also a standalone repo can be found here.
ruby-snowboy

Compiles pretty straight forward on Ubuntu Xenial 64bit

@xuchen
Copy link
Collaborator

xuchen commented Mar 22, 2018

Great. let me know when you finish this PR and we can review it.

@ppibburr
Copy link
Author

Should be finished. I created a C shared lib binding, the Ruby binding that uses the C shared lib, and decoupled the portaudio stuff in to an optional tool provided by the ruby binding, allowing for other audio data sources

@xuchen
Copy link
Collaborator

xuchen commented Mar 26, 2018

when I followed README.md, I got error

$ ruby port-audio-sample.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ffi (LoadError)

please add sudo gem install ffi to README

@xuchen
Copy link
Collaborator

xuchen commented Mar 26, 2018

Great. @chenguoguo please take a look one more time before we merge.

@chenguoguo
Copy link
Collaborator

@ppibburr thanks for the PR. Two high level comments:

  1. Could you move bindings/C to swig/Ruby/C, and then bindings/Ruby to swig/Ruby? I know you are not using the software swig, but swig also means Simplified Wrapper and Interface Generator, so we'll keep using that directory for creating wrappers.

  2. Could you make files snowboy-detect-c-wrapper.{h,cc} (and other files if you copy them over) soft links instead of hard copies? This way, when we do update, we only have to update one source code.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants