[go: up one dir, main page]

File: test_cdrecord.py

package info (click to toggle)
audiotools 3.1.1-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 18,200 kB
  • sloc: ansic: 417,746; python: 59,089; xml: 1,639; makefile: 303; sh: 99
file content (47 lines) | stat: -rwxr-xr-x 1,772 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/python

# Audio Tools, a module and set of tools for manipulating audio data
# Copyright (C) 2007-2015  Brian Langenberger

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# 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()