my $data = $dsp->dread(16) || die $dsp->errsttr();
$dataf = filter($data, {type => 'bandpass' , fclo => 12 , fchi => 19 });
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#!/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);