I'm trying to get an audio player working with Crystal. The internet indicated that portaudio was the best C library for playing audio, and seeing as there are no native Crystal libraries, it seems like the best option.
Someone already put in most of the work for binding the portaudio API to Crystal, but the project is out of date and seems to have been broken by a Crystal update. I'm thinking it will be easier to fix someone else's bindings, than do the whole things from scratch.
That was an unnecessarily long introduction. When I try to compile crystal-portaudio
, I get the following error:
$ crystal src/portaudio.cr ~/sw/crystal/crystal-portaudio (master)
Error in src/portaudio.cr:1: while requiring "./portaudio/*"
require "./portaudio/*"
^
in src/portaudio/device.cr:2: while requiring "./host_api"
require "./host_api"
^
in src/portaudio/host_api.cr:5: can't use instance variables at the top level
delegate :device_count, :default_input_device, :default_output_device, :type, @info
^~~~~