''' This example displays the bitstreams found in an Ogg file and allows the user to select one for extraction into a seperate file. by Arc Riley ''' import sys try: import ogg2 except: print 'Could not import ogg2 module.' sys.exit(1) def getserials(f) : streams = [] def testpage(page) : if page.bos : try : streams.index(page.serialno) except ValueError : print len(streams), page.serialno streams.append(page.serialno) sync = ogg2.OggSyncState() while sync.input(f) : while 1 : page = sync.pageout() if page == None : break testpage(page) return streams def chooseprompt(streams) : while 1: choice = raw_input('Index: ') if choice.isdigit() : choice = int(choice) if choice>-1 and choice