Skip to content

Ruby's PulseAudio bindings written using FFI ***IT IS NOT MAINTAINED***

Notifications You must be signed in to change notification settings

mspanc/pulseaudio-ffi-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a wrapper to PulseAudio for Ruby.

Here comes a short code sample. Currently almost no docs. Currently it does only a bit more than just connecting to PA server and reading some of it parameters, but please note that this is new and rapidly evolving project.

require 'glib2'
require 'lib/pulseaudio'

pa = PulseAudio::Asynchronous::Context.new 
pa.state_callback_proc = Proc.new{ |context, user_data|
   puts "Connection state has changed to #{context.state}"

   if context.state == :ready
     puts "I am connected, my index is #{context.index}"

     context.operation.clients.all do |operation, list, user_data|
       puts "List of all clients connected to this PulseAudio server:"

       puts list.inspect
     end
   end
}

pa.connect

GLib::Timeout.add(3000) do
  puts "Disconnecting"
  pa.disconnect
end

mainloop = GLib::MainLoop.new
mainloop.run

Please notice that code is very young, not well-tested and can contain bugs. API is not stable.

Installation

Supported Ruby versions

It was tested with ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux] under Ubuntu 10.10.

From the GitHub source

The source code is available at github.com/saepia/pulseaudio-ffi-ruby.

About

Ruby's PulseAudio bindings written using FFI ***IT IS NOT MAINTAINED***

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published