#!/usr/bin/perl use strict; use warnings; use utf8; use GStreamer -init; #Pipeline: #gst-launch alsasrc device=hw:2,0 ! audio/x-raw-int, #format=S16LE, width=16, depth=16, rate=48000, channels=1 ! #audioconvert! audiochebband type=1 poles=28 ripple=0.200 lower-#frequency=12000 upper-frequency=19000 ! audioconvert ! #tcpserversink host=loclahost port=3000 #Cient pipeline # gst-launch tcpclientsrc port=3000 ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=48000, channels=1 ! # audioconvert ! alsasink device=hw:3,0 my $pipeline = GStreamer::Pipeline->new("my_pipeline"); #Capabilities my $caps = GStreamer::Caps->from_string("audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=48000, channels=1"); #ElementFactory my( $src, $audioconvert, $filter, $capsconvert, $sink ) = GStreamer::ElementFactory -> make( #sound source alsasrc => "sound_src", audioconvert => "convert1", #band-pass filter audiochebband => "band-pass Filter", audioconvert => "capsconvert", #tcp server tcpserversink => "sound_sink", ); $src->set(device => "hw:2,0"); $filter->set(mode => 'band-pass'); $filter->set(type => 1); $filter->set(ripple => 0.200); $filter->set(poles => 28); $filter->set("lower-frequency" => 12000); $filter->set("upper-frequency" => 19000); $sink->set(host => "localhost"); $sink->set(port => 3000); $pipeline->add($src, $audioconvert, $filter, $capsconvert, $sink); $capsconvert->link_filtered($src, $caps); $src->link($audioconvert, $filter, $capsconvert, $sink);