예제 #1
0
 def __init__(self, pcmreader):
     self.pcmreader = audiotools.BufferedPCMReader(pcmreader)
     self.sample_rate = pcmreader.sample_rate
     self.channels = pcmreader.channels
     self.channel_mask = pcmreader.channel_mask
     self.bits_per_sample = pcmreader.bits_per_sample
     self.md5 = md5()
     self.range = range(self.channels * (self.bits_per_sample // 8), 4096)
예제 #2
0
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

import sys
import audiotools
import test_streams
import cPickle

if (__name__ == "__main__"):
    write_offset = audiotools.config.getint_default("System",
                                                    "cdrom_write_offset", 0)

    sine = audiotools.BufferedPCMReader(
        audiotools.PCMReaderWindow(
            test_streams.Sine16_Stereo(12397980 + 10862124, 44100, 441.0, 0.50,
                                       4410.0, 0.49, 1.0), write_offset,
            12397980 + 10862124))

    f = open(sys.argv[5], "wb")

    cPickle.dump(
        audiotools.pcm_frame_cmp(audiotools.LimitedPCMReader(sine, 12397980),
                                 audiotools.open(sys.argv[8]).to_pcm()), f)

    cPickle.dump(
        audiotools.pcm_frame_cmp(audiotools.LimitedPCMReader(sine, 10862124),
                                 audiotools.open(sys.argv[9]).to_pcm()), f)

    f.close()