Audio-StreamGenerator

 view release on metacpan or  search on metacpan

lib/Audio/StreamGenerator.pm  view on Meta::CPAN

Use this method instead of L</"stream"> if you want to have more control over the streaming process, for example, running the streamer inside an event loop:

    use Mojo::IOLoop;

    my $loop = Mojo::IOLoop->singleton;
    my $streamer_sub = $streamer->get_streamer(0.5);

    $loop->recurring(0.05 => $streamer_sub);
    $loop->start;

Note: event loop will be blocked for up to 0.5 seconds every time the timer is done. The timer/streamer ratio should be sizeable enough for the loop to run smoothly, including the mixing process. This may vary depending on the speed of the machine wh...

=head2 skip

    $streamer->skip();

Skip to the next track without finishing the current one. This can be called from the L</"run_every_second"> sub, for example after checking whether a 'skip' flag was set in a database, or whether a file exists.

=head2 get_elapsed_samples

    my $elapsed_samples = $streamer->get_elapsed_samples();



( run in 0.348 second using v1.01-cache-2.11-cpan-4ee56698ea0 )