Пример #1
0
        self.__can_start = False
    
    def stop (self):
        self.oper.stop ()
        
    can_start = property (lambda self: self.__can_start)
    
    running = property (lambda self: self.__oper != None)


def fileIsPcmWav (filename):
    src = gst.element_factory_make ("filesrc")
    src.set_property ("location", filename)
    return IsWavPcm (src)
fileIsPcmWav = operations.async(fileIsPcmWav)
fileIsPcmWav = operations.operation_factory(fileIsPcmWav)

def gvfsIsPcmWav(uri):
    src = gst.element_factory_make("gnomevfssrc")
    src.set_property("location", uri)
    return IsWavPcm(src)

gvfsIsPcmWav = operations.async(gvfsIsPcmWav)
gvfsIsPcmWav = operations.operation_factory(gvfsIsPcmWav)

def sourceToWav (source, sink):
    """
    Converts a given source element to wav format and sends it to sink element.
    
    To convert a media file to a wav using gst-launch:
    source ! decodebin ! audioconvert ! audioscale !$WavPcmParse ! wavenc
Пример #2
0
    
    def start(self):
        self.oper.start()
        self.__can_start = False
    
    def stop(self):
        self.oper.stop()
        
    can_start = property(lambda self: self.__can_start)
    
    running = property(lambda self: self.__oper != None)

def is_wav_pcm(source, location):
    return IsWavPcm(create_source(source, location))

is_wav_pcm = operations.operation_factory(is_wav_pcm)
is_wav_pcm = operations.async(is_wav_pcm)

################################################################################
def source_to_wav(source, sink):
    """
    Converts a given source element to wav format and sends it to sink element.
    
    To convert a media file to a wav using gst-launch:
    source ! decodebin ! audioconvert ! audioresample ! audioconvert ! wavenc
    """
    
    bin = gst.parse_launch(
        "decodebin name=stw_decodebin ! audioconvert ! "
        "audioresample ! audioconvert ! %s ! wavenc name=stw_wavenc" % _WAV_PCM_PARSE
    )
Пример #3
0
    def stop(self):
        self.oper.stop()

    can_start = property(lambda self: self.__can_start)

    running = property(lambda self: self.__oper != None)


def fileIsPcmWav(filename):
    src = gst.element_factory_make("filesrc")
    src.set_property("location", filename)
    return IsWavPcm(src)


fileIsPcmWav = operations. async (fileIsPcmWav)
fileIsPcmWav = operations.operation_factory(fileIsPcmWav)


def gvfsIsPcmWav(uri):
    src = gst.element_factory_make("gnomevfssrc")
    src.set_property("location", uri)
    return IsWavPcm(src)


gvfsIsPcmWav = operations. async (gvfsIsPcmWav)
gvfsIsPcmWav = operations.operation_factory(gvfsIsPcmWav)


def sourceToWav(source, sink):
    """
    Converts a given source element to wav format and sends it to sink element.
Пример #4
0
        self.oper.start()
        self.__can_start = False

    def stop(self):
        self.oper.stop()

    can_start = property(lambda self: self.__can_start)

    running = property(lambda self: self.__oper != None)


def is_wav_pcm(source, location):
    return IsWavPcm(create_source(source, location))


is_wav_pcm = operations.operation_factory(is_wav_pcm)
is_wav_pcm = operations. async (is_wav_pcm)


################################################################################
def source_to_wav(source, sink):
    """
    Converts a given source element to wav format and sends it to sink element.
    
    To convert a media file to a wav using gst-launch:
    source ! decodebin ! audioconvert ! audioresample ! audioconvert ! wavenc
    """

    bin = gst.parse_launch(
        "decodebin name=stw_decodebin ! audioconvert ! "
        "audioresample ! audioconvert ! %s ! wavenc name=stw_wavenc" %