X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftest%2Ftest.py;h=4340ca11b8f750c46ab150339c0c26480efbe287;hb=094e4ad1b97bd31f9e56192f0d2e365c251dc92e;hp=d8ffd13cad8d84ac32443804d76135644ce84623;hpb=8be1424a46b3fce8ddb83e3f0409d7a4c66775b4;p=deb_shairplay.git diff --git a/src/test/test.py b/src/test/test.py index d8ffd13..4340ca1 100644 --- a/src/test/test.py +++ b/src/test/test.py @@ -3,18 +3,26 @@ from struct import * from Shairplay import * hwaddr = pack('BBBBBB', 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB) +class SampleCallbacks(RaopCallbacks): + def audio_init(self, bits, channels, samplerate): + print "Initializing " + str(bits) + " " + str(channels) + " " + str(samplerate) + def audio_process(self, session, buffer): + print "Processing " + str(len(buffer)) + " bytes of audio" shairplay = LoadShairplay(".") +callbacks = SampleCallbacks() -raop = RaopService(shairplay, RaopCallbacks()) +raop = RaopService(shairplay, callbacks) port = raop.start(5000, hwaddr) dnssd = DnssdService(shairplay) -dnssd.register_raop("RAOP test", port) +dnssd.register_raop("RAOP test", port, hwaddr) time.sleep(50) dnssd.unregister_raop() raop.stop() + +del dnssd del raop