This is a read-only archive of the Mumble forums.

This website archives and makes accessible historical state. It receives no updates or corrections. It is provided only to keep the information accessible as-is, under their old address.

For up-to-date information please refer to the Mumble website and its linked documentation and other resources. For support please refer to one of our other community/support channels.

Jump to content

ICE and Python


nickeh
 Share

Recommended Posts

Hi,


I tried to connect to my Mumble server using ICE and Python but I can't get it to work.

I have copied Murmur.ice to the same folder as my python script but when I execute the script

 

import Ice
Ice.loadSlice("Murmur.ice")

 

I get this:

 

error: Can't open include file "Ice/SliceChecksumDict.ice"
   #include <Ice/SliceChecksumDict.ice>

 

I found the SliceChecksumDict.inc under /usr/share/Ice-3.5.1/slice/Ice/SliceChecksumDict.ice and I tried to copy it to a subfolder called Ice under the folder were my python scrip was but without success.


There is probably a very easy solution to this but I havn't figured it out.


Thanks in advance!

Link to comment
Share on other sites

Thanks darkman802!!!


How do I provide the ICE read/write password? I have this code

 

#!/usr/bin/python
import Ice
Ice.loadSlice('-I/usr/share/Ice-3.5.1/slice', ['Murmur.ice'])
import Murmur

comm = Ice.initialize()
pxy = comm.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
meta = Murmur.MetaPrx.checkedCast(pxy)
server = meta.getServer(1)
channels = server.getChannels()
users = server.getUsers()

 

and I get this output indicating that I'm missing the credentials

 

Traceback (most recent call last):
 File "mumbleICE.py", line 9, in <module>
   server = meta.getServer(1)
 File "Murmur.ice", line 3949, in getServer
   
Murmur.InvalidSecretException: exception ::Murmur::InvalidSecretException
{
}

Link to comment
Share on other sites

Yes, I found that line before but when I use it I get this

 

comm.getImplicitContext().put('secret', 'mySecretHere')
AttributeError: 'NoneType' object has no attribute 'put'

 

the whole code looks like this.

#!/usr/bin/python
import Ice
Ice.loadSlice('-I/usr/share/Ice-3.5.1/slice', ['Murmur.ice'])
import Murmur

comm = Ice.initialize()
comm.getImplicitContext().put('secret', 'read')
pxy = comm.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
meta = Murmur.MetaPrx.checkedCast(pxy)
server = meta.getServer(1)
channels = server.getChannels()
state = server.getChannelState(2)
users = server.getUsers()

 

Also what should I look for when I want to see who is talking on the channels including anyone whispering (to another channel and to whom)?


Maybe I should have explained my case from the beginning but here it goes :)


I'm trying to use Mumble as a intercom for broadcast. For now I have figured out how the beltpacks should work but the basestation requires the operator to see who is calling. The beltpacks are based on Olimex A20 mini computers (about the same size as a Raspberry Pi case) that only have one button (headless and only running Mumble + python script). When the button is pressed a python script reads the GPIO and sends (the set key code to Mumble running in X) for example CTRL+1 (Whisper to the Director) as long as it is pressed.


There are in the beginning atleast two basestations (small box on the table, Video (Director) + Audio (Sound Designer)) and the director has for example three buttons. One button for talking to cameras CTRL+1 = Whisper to camera group, CTRL + 2 Floormanager and CTRL +3 Audio basestation (Sound Designer). When a button is pressed a led will light up showing that is broadcasting, double clicking locks the channel to stay broadcasting. If for example the Sound Engineer (Audio channel) wants to talk to the director (that sits in the Video channel) he/she can hear the broadcast but I would like to have another led lighing up above the audio button so that is easier to see who is broadcasting. That's is why I would like to find who is talking to who.


Example channel setup (I didn't remember how all titles are translated so a few are probably wrong :) )


Audio

-Sound Designer

-Sound Technician 1

-Sound Technician 2

Video

-Director

-CAM 1

-CAM 2

-CAM 3

-FM

LIGHT (in future)

-Head of Camera

-Lightdesk

-Light Technician 1


and the list could go on :)

Link to comment
Share on other sites

  • Moderators

It's been ages since I mucked around with Ice under Python, but try switching the order around:

 

comm = Ice.initialize()
pxy = comm.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")
comm.getImplicitContext().put('secret', 'read')

I'm not sure if it'll help or not, but Ice does lots of things weird.

Full disclosure: I used to run a commercial Mumble host, and my opinions do not reflect the opinions of the Mumble project.

Avatar is stolen from here

Link to comment
Share on other sites

You probably need to set up the shared context in Ice.

 

initdata = Ice.InitializationData()
initdata.properties = Ice.createProperties(None, initdata.properties)
initdata.properties.setProperty('Ice.ImplicitContext', 'Shared')
comm = Ice.initialize(sys.argv, initdata)
comm.getImplicitContext().put('secret', 'mySecretHere')

Link to comment
Share on other sites

The Ice interface is documented here: http://mumble.sourceforge.net/slice/1.3.0/Murmur.html


It lists all the interfaces, methods, callbacks, structures, etc. You'd have to look around to see if any of those would be able to tell you about whispering and such.


Mumble also has an IRC channel you could join to talk to people about it, though people are not always around.


The channel is #mumble on irc.freenode.org

Link to comment
Share on other sites

 Share

×
×
  • Create New...