BookBeaming: Difference between revisions

From OLPC
Jump to navigation Jump to search
Line 22: Line 22:


===example source code for audio===
===example source code for audio===
Records the currently tuned in channel via usb. Requires pyusb.
Records the current channel via usb. Requires pyusb.
import usb
import usb
import struct
import struct

Revision as of 18:15, 26 January 2008

Xo s.png
pre-alpha

Description & Goals

Summary

BookBeaming receives static content using a conventional World Space satellite radio.

Status

The prototyp works with the TONGSHI DAMB-R Radio and the Africa Learning Channel. As of 26.01.08 any active audio stream can be tapped and recorded. This was however not the original purpose. Since January the prototyp is broken due to changes in the codewords used. Specifications appear to be nonpublic.

Goals

Access to a wide range of content from the weather report to health care.available content

Collaboration

Sharing one satellite radio could bypass satellite radio shortage in an particular areas.


example source code for audio

Records the current channel via usb. Requires pyusb.

import usb
import struct
def opendevice(idVendor, idProduct):
   devices=[]
   for b in usb.busses():
       for d in b.devices:
           if d.idVendor==idVendor and d.idProduct==idProduct:
               devices.append(d)
   if len(devices)==1:
       device=devices[0]
       return device
   elif not devices:
       raise "Device not found"
   else:
       raise "More than one device found"
def read(dh):
 try:
        r = dh.bulkRead(0x00000082,0x40,10)
 except:
        return read(dh)
 return struct.pack(64*'b',*r)
if __name__=="__main__":
   device1=opendevice(0x174e, 0x5357)
   dh=device1.open()
   dh.claimInterface(0)
   flob=open('out.mp3','wb')
   while 1==1:
                buffer1 = read(dh)
                buffer2 = read(dh)
                d = "".join([buffer1, buffer2])
                #print repr(d) console out
                flob.write(d)
   fileobj.close()

See also

Peripherals/Satellite_Broadcasting