Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Compu Kasem (a Cyber-DJ)

by otterfish (Initiate)
on May 15, 2002 at 06:53 UTC ( [id://166655]=note: print w/replies, xml ) Need Help??


in reply to Compu Kasem (a Cyber-DJ)

Brilliant! Definitely a "Cool Use For Perl"!

I had to make a couple of changes to get things working smoothly. I've moved the following code above the for loop as it kept spawning new processes of mpg123 every iteration and grinding my machine to a halt:

my $player = new Audio::Play::MPG123;

Also, none of my MP3s have ID3 tags (because I remove them with a passion!). All my files follow the format "Artist - Song Title.mp3" so I've added the following in place of the MP3::Info so that CompuKasem can do his thing:

      if ($_ =~ m/(a-zA-Z0-9\ +)\ \-\ (a-zA-Z0-9\ +)\.mp3/)
      {
        $this_artist = $1;
        $this_song = $2;
      }

Now all that's needed is "Gillian Anderson" voice file and I'm set! Cheers!

Replies are listed 'Best First'.
(ichi) re x 2: Compu Kasem (a Cyber-DJ)
by ichimunki (Priest) on May 16, 2002 at 17:26 UTC
    Odd that you should have to move that object out of the loop. I'll have to check my process list to make sure I don't have an abundance of mpg321s around myself. Since the object goes out of scope after each song, one would hope that would kill the process... or that the process would die when it is done playing the file... or both. On my machine, if I didn't do that I seemed to have trouble getting /dev/dsp free for festival again. Thanks for pointing this out. I'll have to look into it.
Re: Re: Compu Kasem (a Cyber-DJ)
by Anonymous Monk on May 30, 2002 at 17:46 UTC
    I had the same problem. When moving the call to MPG123 outside the loop it solved the problem, except now mpg123 goes nuts after playing the last song. Any ideas? Otherwise, this was a very fun thing to try out - I think I will actually use it when I get my mp3 machine setup at home. Thanks....
      ahhh, read the documentation you say? Yes, the docs for Audio::Play::MPG123 say to use the version of mpg123 that comes with the module! I did that and the problem went away. You can now put the call to my $player = new Audio::Play::MPG123; inside the loop again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://166655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found