Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 30.449.926 Times

POE::Component::Audio::Mad::Dispatch 0.3

  Date Added: August 16, 2010  |  Visits: 806


Report Broken Link
Printer Friendly Version

Product Homepage
Download (71 downloads)

POE::Component::Audio::Mad::Dispatch is a POE::Component::Audio::Mad frontend implementing listener based message dispatch. SYNOPSIS use POE; use POE::Component::Audio::Mad::Dispatch; ## we print some stuff below, and we dont want it ## to get buffered.. so turn on autoflush. $| = 1; ## create our frontend session, which will create a decoder and ## forward its messages to all interested listeners.. create POE::Component::Audio::Mad::Dispatch({ decoder_play_on_open => 1, alias => mad-decoder }); POE::Session->create(inline_states => { _start => &ex_start, mad_decoder_input => &ex_input }); sub ex_start { my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION]; ## add ourself in as a listener, and register for the DECODER_FRAME_DATA and ## IPC_SHUTDOWN_SUCCESS events. The decoder core will then call the ## mad_decoder_input state in the current session when these ## events arrive.. ## this also has the added benefit of keeping a reference to our ## session alive in the event notification list. Our session will ## remain alive as long as we are a registered listener.. $heap->{lid} = $kernel->call(mad-decoder, add_listener, $session, mad_decoder_input, [ DECODER_FRAME_DATA, INPUT_EOF_WARNING ]); ## tell our decoder to start playing a stream.. $kernel->post(mad-decoder, decoder_open, { filename => /path/to/stream.mp3, play => 1 }); } sub ex_input { my ($kernel, $heap, $msg) = @_[KERNEL, HEAP, ARG0]; ## this is called when the decoder has generated an event ## that we have registered for. the message packet is ## contained in ARG0, and is a hashref with two ## fields ->{id} and ->{data}. id specifies the name ## of the event, and data contains a reference to ## the data included in this event.. if ($msg->{id} eq DECODER_FRAME_DATA) { ## we got a message updating us as to player ## progress, the data part of the event will ## contain two values: ->{played} and ->{progress}, ## played is the number of seconds of stream ## played.. print "rplayed: $msg->{data}->{played}" if (defined($msg->{data}->{played})); } elsif ($msg->{id} eq INPUT_EOF_WARNING) { ## we got a message telling us that the ## decoder system has come to the end of ## the current stream, use it as a queue ## to shutdown.. print "nshutting down..n"; $kernel->post(mad-decoder, decoder_shutdown); } else { ## unknown messages should never happen, but ## we could do something interesting with them ## here.. for simplicity, we just ignore it. return; } } ## start this thing.. $poe_kernel->run(); exit(); POE::Component::Audio::Mad::Dispatch implements a multiple dispatch front end component for the POE::Wheel::Audio::Mad mpeg decoder. It receieves status messages from the decoder and dispatches them to other registered "listener" sessions. All of the states listed in POE::Wheel::Audio::Mad(3) under STATES will be defined within this components session. To control the decoder, simply post the appropriate POE::Wheel::Audio::Mad STATE to this session. If you intend to implement a decoder that will be controlled and/or monitored by other POE::Sessions, then this is the module you want to be using. If you wish to implement a decoder through an IPC bridge, you want POE::Component::Audio::Mad::Handle..

Requirements: No special requirements
Platforms: Linux
Keyword: Data Decoder Frame Frontend Input Libraries Listener Message Poe Poecomponentaudiomaddispatch Programming Session
Users rating: 0/10

License: Freeware Size: 22.53 KB
Utilities  -  Pipemeter 1.1.3
Pipemeter is a command line utility that displays the speed and, if possible, progress, of data moving from its input to its output..
18.43 KB  
Libraries  -  Pod::Dsr 1.02
Pod::Dsr is a Perl module Convert POD data to formatted DSR input SYNOPSIS use Pod::Dsr; my $parser = Pod::Dsr->new (release => $VERSION, section => 8); # Read POD from STDIN and write to STDOUT. $parser->parse_from_filehandle; # Read...
102.4 KB  
Libraries  -  pod2man 5.6.2
pod2man is a Perl module that can convert POD data to formatted *roff input. SYNOPSIS pod2man [--section=manext] [--release=version] [--center=string] [--date=string] [--fixed=font] [--fixedbold=font] [--fixeditalic=font]...
6 MB  
Compression Tools  -  ComprLib Data Manipulation Library b20
ComprLib is a library providing a flexible and easy to use interface for encoding and decoding of data, independent of the input and output sources. New codecs able to encode/decode Arithmetic to LZSS have been ported.
3.81 MB  
Text Management  -  Design mini-lanugage 1.0
This script uses Python's superb text handling capability to parse and build the data structure from the input text.
Communication  -  Speech Spectrogram 1.0
Takes a vector containing audio data samples as an input, computes short-time Fourier transform (STFT) and plots the STFT power spectrum trajectories across time.
2.87 MB  
Science  -  MacCRO X 1
An oscilloscope and spectrum analyser, capable of analysing data captured from sound input devices.
64.81 KB  
Programming  -  jplaintext 0.3
jplaintext is a Java library to deal with data from plain text input. Plain text files are still around and sometimes a Java program wants to process data from plain text source. Reading this data into POJO could be lead to lot of...
40.96 KB  
Site Security Tools  -  django-frontendadmin 0.4
django-frontendadmin is a set of template tags to allow an easy and unobtrusive way to edit model-data in the frontend of your page. Example project This package provides an easy example project, a weblog with comments. Here...
10.24 KB  
Business  -  CNB exchange rates
Designed for the ASD consulting ltd. as a simple application for the retrieving rate of the Czech National Bank including the ability to change date of the exchange list. Subsequently, the obtained data is possible to forward as SMS message or as...
1024 KB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.12.2
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB