3 from Shairplay
import *
5 hwaddr
= pack('BBBBBB', 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB)
6 class SampleCallbacks(RaopCallbacks
):
7 def audio_init(self
, bits
, channels
, samplerate
):
8 print "Initializing " + str(bits
) + " " + str(channels
) + " " + str(samplerate
)
9 def audio_process(self
, session
, buffer):
10 print "Processing " + str(len(buffer)) + " bytes of audio"
12 shairplay
= LoadShairplay(".")
13 callbacks
= SampleCallbacks()
15 raop
= RaopService(shairplay
, callbacks
)
16 port
= raop
.start(5000, hwaddr
)
18 dnssd
= DnssdService(shairplay
)
19 dnssd
.register_raop("RAOP test", port
, hwaddr
)
23 dnssd
.unregister_raop()