20140409

Adding receive audio to mumble-ruby

For my upcoming project, RPi Headset, I needed the ability to pull audio from the current mumble channel and send it to the speaker. The problem, is that the Mumble-Ruby library only had support for sending audio to the current channel. I started looking into what it would take to add this feature. I realized that the Opus-Ruby library didn't have support for decoding Opus packets. Two weeks later, I'm was still banging my head against the problem. In hindsight, I realize that I was trying to diagnose too many problems at once:

  • Trying to work with C and pointers in Ruby
    • When Ruby throws a fatal stack overflow error you know you're doing something silly
  • Learning libopus
    • I don't know how much I can blame on their doc or on my own lack of working with audio libraries before. Probably a bit of both.
  • Learning the Mumble protocol
    • This I will blame on their doc. It is outdated, incomplete, and/or not presented in a very understandable form. (I won't fault the devs for this issue. They aren't the most staffed of FOSS projects.)
Earlier this week, I finally had some useful(ish) audio coming out of my speakers; not great, but recognizable. Yesterday, I stepped into #opus on freenode, and described my problem. Within half an hour, they'd helped me realize that I'd overlooked that fact that the opus_decode function returns a number of shorts not bytes contained in the decoded array. Audio then worked great, I cleaned up the code and pushed it up.


[Original Issue]

5 comments:

  1. Great work, I am doing a project where I need to start and stop a mumble client from the console. I was looking and apparently only mumble-client is possible but was the limiting audio reception. I already solucionaste. Podriames You tell me I should do to accomplish what you did. Would you help me with this ?.

    ReplyDelete
    Replies
    1. The project that this was for, I was never able to complete entirely because of the limited compute power of the raspberry pi. If you don't need the form factor of the r-pi, the mumble-ruby library will work. Head to the project on GitHub (https://github.com/perrym5/mumble-ruby) for more information.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I read your blog frequently, and I just thought I’d say keep up the fantastic work! It is one of the most outstanding blogs in my opinion. bestsoundbarlab.com

    ReplyDelete
  4. The AVR-S930H is the most exceptional Denon S Series home amusement arrangement with a total arrangement of cutting edge sound and video highlights. On account of the implicit HEOS remote innovation, you can stream and control all your nearby or o Techunderworld for Denon avr-s930h review

    ReplyDelete