Guest User

Untitled

a guest
Mar 6th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. def getBit(byteArray, bitNumber):
  2.     "This returns bit with bitNumber position from byteArray"
  3.     byte = byteArray[bitNumber // 8]
  4.     return (byte >> (bitNumber % 8)) & 1
  5.  
  6. #while True:
  7. for x in range(0, inputFileSize//2):
  8.     multiChannelSample = b'aa'#inputFile.read(SAMPLE_LENGTH)
  9.     if multiChannelSample == b'':
  10.         break
  11.    
  12.     for channel in range(0, NUMBER_OF_CHANNELS):
  13.         singleChannelSample = '+1' if (getBit(multiChannelSample, channel)) else '-1'
  14.         #outputFiles[channel].write(singleChannelSample + '\n')
  15.        
  16.     sampleCounter += 1
Advertisement
Add Comment
Please, Sign In to add comment