In this section we will develop a utility that will cut out a portion of an MP3 formatted audio and save it as a separate file.
Keep the file
AudioCutter.py
handy. You can download it from the Packt website. Here we will only discuss important methods. The methods not discussed here are similar to the ones from earlier examples. Review the fileAudioCutter.py
which has all the necessary source code to run this application.Start the usual way. Do the necessary imports and write the following skeleton code.
import os, sys, time import thread import gobject import pygst pygst.require("0.10") import gst class AudioCutter: def __init__(self): pass def constructPipeline(self): pass def gnonlin_pad_added(self, gnonlin_elem, pad): pass def connectSignals(self): pass def run(self): pass def printFinalStatus(self): pass def message_handler(self, bus, message): pass #Run the program audioCutter = AudioCutter() thread.start_new_thread...