libluaradio
libluaradio
Crystal Bindings For LuaRadio
Why
I have written an Audio Player called Sonicri in the Crystal language which plays audio files, internet radio, and podcasts. I wanted to add terrestrial FM and AM radio stations and discovered LuaRadio. These bindings enable me to embed suitable radio players into Sonicri.
Dependencies
- LuaRadio (Installation instructions)
- fftw3f
- volk or liquid
Installation
Add this to your application's shard.yml
:
dependencies:
libluaradio:
github: mjago/libluaradio
Usage
require "libluaradio"
See the examples for usage. The flow-graph is a Lua script. See LuaRadio project docs for more details.
Examples:
(Note: The examples decode a recorded IQ data file. Generally you would decode an SDR device plugged into a USB port, such as a cheap RTLSDR usb stick - see Ebay.)
First download an IQ recording data file called fm-capture.dat to the examples directory:
> wget -O examples/fm-capture.dat http://martynjago.co.uk/blog/audio/fm-capture.dat
Then run the examples
> crystal examples/wbfm1.cr
> crystal examples/wbfm2.cr
> crystal examples/wbfm_stereo.cr
Excellent documentation for the LuaRadio project can be viewed here
Debug:
To see debug info during play use the following:
> LUARADIO_DEBUG=1 crystal examples/wbfm_stereo.cr
Contributing
- Fork it ( https://github.com/mjago/libluaradio/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- mjago mjago - creator, maintainer
libluaradio
- 0
- 0
- 0
- 0
- 0
- over 6 years ago
- May 19, 2018
MIT License
Fri, 22 Nov 2024 13:02:48 GMT