コード例 #1
0
ファイル: waveform.py プロジェクト: dittos/PyWaveform
import cwaveform

__version__ = '0.4'

def draw(inAudioFile, outImageFile, (imageWidth, imageHeight), cheat=False):
    """
    Draws the waveform of inAudioFile to picture file outImageFile.
    """
    return cwaveform.draw(inAudioFile, outImageFile, imageWidth, imageHeight, cheat)
コード例 #2
0
__version__ = '0.4'


def draw(inAudioFile,
         outImageFile,
         (imageWidth, imageHeight),
         bgColor=(0, 0, 0, 0),
         fgColor=None,
         fgGradientCenter=None,
         fgGradientOuter=None,
         cheat=False):
    """
    Draws the waveform of inAudioFile to picture file outImageFile.
    If a fgColor is specified, the image will be drawn with only that color.
    If fgGradientCenter and fgGradientOuter are specified, a gradient will
        be constructed.
    """
    if fgColor == None:
        fgColor = (0, 0, 0, 255)

    if fgGradientCenter == None or fgGradientOuter == None:
        fgGradientCenter = fgColor
        fgGradientOuter = fgColor

    return cwaveform.draw(inAudioFile, outImageFile, imageWidth, imageHeight,
                          bgColor[0], bgColor[1], bgColor[2], bgColor[3],
                          fgGradientCenter[0], fgGradientCenter[1],
                          fgGradientCenter[2], fgGradientCenter[3],
                          fgGradientOuter[0], fgGradientOuter[1],
                          fgGradientOuter[2], fgGradientOuter[3], cheat)
コード例 #3
0
ファイル: waveform.py プロジェクト: AstroScatter/PyWaveform
import cwaveform

__version__ = '0.4'

def draw(inAudioFile, outImageFile, (imageWidth, imageHeight), bgColor=(0, 0, 0, 0), fgColor=None, fgGradientCenter=None, fgGradientOuter=None, cheat=False):
    """
    Draws the waveform of inAudioFile to picture file outImageFile.
    If a fgColor is specified, the image will be drawn with only that color.
    If fgGradientCenter and fgGradientOuter are specified, a gradient will
        be constructed.
    """
    if fgColor == None:
        fgColor=(0, 0, 0, 255)

    if fgGradientCenter == None or fgGradientOuter == None:
        fgGradientCenter = fgColor
        fgGradientOuter = fgColor

    return cwaveform.draw(inAudioFile, outImageFile, imageWidth, imageHeight,
        bgColor[0], bgColor[1], bgColor[2], bgColor[3],
        fgGradientCenter[0], fgGradientCenter[1], fgGradientCenter[2], fgGradientCenter[3],
        fgGradientOuter[0], fgGradientOuter[1], fgGradientOuter[2], fgGradientOuter[3],
        cheat)