Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just a mix of answer and op code ( <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-audiocheblimit.html" rel="nofollow">sample pipe</a> )</p> <pre><code>#!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk, gst, time class HelloWorld: def delete_event(self, widget, event, data=None): print "delete event occurred" return False def destroy(self, widget, data=None): print "destroy signal occurred" gtk.main_quit() def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) self.window.set_border_width(2) #self.window.set_size_request(600, 483) """ Play """ self.vbox = gtk.VBox(False, 2) self.vbox.set_border_width(0) self.hbox = gtk.HBox() self.hlpass = gtk.Entry() self.hlpass.set_text("low-pass") self.hbox.pack_start( gtk.Label("High/Low-pass: "), False, False, 0 ) self.hbox.pack_start( self.hlpass, False, False, 0 ) self.vbox.add(self.hbox) self.hbox = gtk.HBox() self.cutoff = gtk.Entry() self.cutoff.set_text("40") self.hbox.pack_start( gtk.Label("Cutoff: "), False, False, 0 ) self.hbox.pack_start( self.cutoff, False, False, 0 ) self.vbox.add(self.hbox) self.hbox = gtk.HBox() self.poles = gtk.Entry() self.poles.set_text("4") self.hbox.pack_start( gtk.Label("Poles: "), False, False, 0 ) self.hbox.pack_start( self.poles, False, False, 0 ) self.vbox.add(self.hbox) self.hbox = gtk.HBox() self.button = gtk.Button("High-Pass") self.button.connect("clicked", self.change, None) self.hbox.pack_start(self.button, False, False, 0 ) self.vbox.add(self.hbox) self.window.add(self.vbox) self.window.show_all() def main(self): self.gst() gtk.main() def gst(self): test = """ alsasrc device=hw:0 ! audioconvert ! audioresample ! audiocheblimit mode=low-pass cutoff=40 poles=4 name=tuneit ! level ! autoaudiosink """ self.pipeline = gst.parse_launch(test) self.bus = self.pipeline.get_bus() self.bus.add_signal_watch() self.bus.connect('message', self.playerbinMessage) self.pipeline.set_state(gst.STATE_PLAYING) def playerbinMessage(self,bus, message): if message.type == gst.MESSAGE_ELEMENT: struct = message.structure if struct.get_name() == 'level': print struct['peak'][0], struct['decay'][0], struct['rms'][0] #time.sleep(1) def change(self, widget, data=None): data = [self.hlpass.get_text(), self.cutoff.get_text(), self.poles.get_text()] print data[0], data[1], data[2] self.audiocheblimit = self.pipeline.get_by_name('tuneit') self.audiocheblimit.props.mode = data[0] self.audiocheblimit.props.cutoff = int( data[1] ) self.audiocheblimit.props.poles = int ( data[2] ) if __name__ == "__main__": hello = HelloWorld() hello.main() </code></pre> <p>Output low-pass:</p> <pre><code>-20.9227157774 -20.9227157774 -20.953279177 -20.9366239523 -20.9227157774 -20.9591815321 -20.9290995367 -20.9227157774 -20.9601319723 </code></pre> <p>Output high-pass:</p> <pre><code>-51.2328030138 -42.8335117509 -62.2730163502 -51.3932079772 -43.3559607159 -62.2080540769 -52.1412276733 -43.8784096809 -62.9151309943 </code></pre> <p><strong>EDIT:</strong></p> <pre><code>high-pass = speech and taking all audio low-pass = some audio like when you are talking near the microphone </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload