문제

I'm working on a program for group audio chat on a local network(which helps students in a classroom to talk in random group, not always the students next to them).

It just went smoothly til I can not find a gem to get access to the Microphone and Speaker. Some one suggests I could win32 api on windows, or some shell command on Linux. But I hope that I can do it with ruby if possible.

Could someone give me a solution base on ruby gem to get access to the microphone and speaker? If I miss any necessary detail for you, please let me know.

Thanks in advance.

도움이 되었습니까?

해결책

You can try Ruby-PortAudio

This package contains Ruby bindings to the PortAudio api. PortAudio is a cross- platform interface to your audio hardware.

The ruby-portaudio package supports both PortAudio apis: blocking and non-blocking. The blocking API allows Ruby scripts to iteratively fill a sample buffer which is then written to the audio hardware (later versions will also support reading from a buffer). The non-blocking api allows Ruby programs to act as controllers for audio streams defined by an external callback function. Because the callback function may be run in an interrupt, it is not really feasible to implement one in Ruby. You can, however, write your callback function in a C extension, or you may build your own using LLVM or LibJIT as in http://github.com/jvoorhis/Motivik.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top