Can't gem install hallon-openal

17 views
Skip to first unread message

Andreas Sprotte

unread,
Oct 10, 2012, 3:29:38 PM10/10/12
to ruby-...@googlegroups.com
Hi there,

I've managed use the hallon gem to retrieve track metadata from the spotify api, thanks to the great documentation on Github. Thumbs up for a much needed rails gem!
Now I want to stream tracks with the hallon-openal gem. However, I can't seem to install it... I've installed OpenAL on my local machine and added the paths to the needed .h files, but I'm still getting the following error when running 'gem install hallon-openal'.

Building native extensions.  This could take a while...
ERROR:  Error installing hallon-openal:
ERROR: Failed to build gem native extension.

        /Users/andreas/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb --with-openal-dir=/Library/Frameworks/OpenAL.framework/Versions/A/Headers
checking for ruby.h... yes
checking for OpenAL/alc.h... yes
checking for alcOpenDevice()... no
Missing function alcOpenDevice
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. 

Any ideas to why alcOpenDevice() is missing?? My operating system is osx lion 10.7.5 and I'm using rails 1.9.2-p320. 

Thanks,
Andreas

Kim Burgestrand

unread,
Oct 10, 2012, 4:08:59 PM10/10/12
to Hallon on behalf of Andreas Sprotte
I've installed OpenAL on my local machine and added the paths to the needed .h files, but I'm still getting the following error when running 'gem install hallon-openal'.
On Mac OS X you should not need to install anything related to OpenAL yourself.
The library already exist on your system and is compatible with hallon-openal. Do
uninstall anything related to OpenAL that you installed yourself, and I would expect
it to go much better. :)

— Kim

Andreas Sprotte

unread,
Oct 11, 2012, 7:37:34 AM10/11/12
to ruby-...@googlegroups.com
Thanks for the quick response. I didn't know that OpenAL was included in OSX. I'll try to uninstall and see if that works. Thanks!

On that note, I'm a bit confused on the wether or not the hallon audio driver will work on the client side, and if there is limitations in terms browser support. Do I need to first buffer the audio on the server side and then stream through a costum web player to stream audio directly to the client?

Kim Burgestrand

unread,
Oct 11, 2012, 11:34:08 AM10/11/12
to Hallon on behalf of Andreas Sprotte

On Thursday, 11 October 2012 at 13:37, Hallon on behalf of Andreas Sprotte wrote:

On that note, I'm a bit confused on the wether or not the hallon audio driver will work on the client side, and if there is limitations in terms browser support. Do I need to first buffer the audio on the server side and then stream through a costum web player to stream audio directly to the client?
hallon-openal will not work in a browser. Browsers run javascript, not ruby, or ruby C extensions, and browsers do not have OpenAL.

However, writing something that uses Hallon to stream audio through libspotify down to a web server, which then streams the data out to a client (most likely through websockets — the communication needs to be bidirectional) is entirely possible.

You’d first have to write some kind of server that can stream audio data from Hallon. This can be done by either writing your own Player (https://github.com/Burgestrand/Hallon/blob/master/lib/hallon/player.rb), or you could write an audio driver for Hallon (http://rdoc.info/github/Burgestrand/Hallon/Hallon/ExampleAudioDriver) that receives audio data and streams it out to a client instead of to the speakers. No matter which of the two approaches you choose, you have no practical use of hallon-openal here.

On the client side you’ll need to write a javascript application that can connect to a server capable of streaming raw audio. It would then continuously accept audio data, and use the web audio api (or similar) for playing it in the browser. Receiving audio from the streaming server could either be done via pushes from the server — in which case you’ll need to be able to tell the server to stop sending frames in case the audio buffer on the browser side fills up — or via pulls from the client — in which case you’ll want to pull continuously to keep an in-browser audio buffer filled that the web audio api can grab from in it’s callback (the web audio api is pull-based).

It’s a very complex topic, streaming audio from spotify, down to a server running hallon, down to a browser, which then plays the audio. Awfully fun though.

— Kim

Andreas Sprotte

unread,
Oct 14, 2012, 2:00:15 PM10/14/12
to ruby-...@googlegroups.com
It does sound really fun and would definitely be a useful thing to have! 
However, it is a bit too large scale for the project I'm doing. In short, I was looking for a way to stream audio from my website for use in some interactive data visualization of music. The visualizations requires capabilities for seeking to a position within one audio track. So far I've only come accross an easy way of doing this through soundcloud's api.  The spotify play button, for example, has only enabled interaction by play/pause.. By principle I'm reluctant to the soundcloud api as my goal is to use tracks that someone else own the rights too, and would most definitely be contributing to rights violations. 

I initially had the idea that Hallon could be used to seek to a position within a track but I should have researched the library more properly :)

However, what you're talking about would be really useful though and if I had more time I would definitely look more into that.

Thanks for the elaborate answers!
Reply all
Reply to author
Forward
0 new messages