in reply to Mp3 PLayer. Part Two!
Isn't the problem that you don't know the pid to kill?
Just a suggestion - maybe it would be easier to have perl streaming the current mp3 to a fifo, and have mpg123 play that? See the .signature example in perlipc for a working example.
Question two: Is there anyway to convince perl to read/write mp3 files without dying
You were already on the right track :)
Here's an example of what I meant in 199077:
adam@2cb:~$ perl -e 'open F, "nofx - falling in love.mp3"; binmode F; +open G, ">bleh"; binmode G; while(<F>) { print G; } ' adam@2cb:~$ ls -la nofx\ -\ falling\ in\ love.mp3 bleh -rw-r--r-- 1 adam users 5011330 Sep 20 13:00 bleh -rw-r--r-- 1 adam users 5011330 Jan 24 2002 nofx\ -\ falli +ng\ in\ love.mp3 adam@2cb:~$ cksum nofx\ -\ falling\ in\ love.mp3 bleh 2095826934 5011330 nofx - falling in love.mp3 2095826934 5011330 bleh
The original/new files end up exactly the same - perl is handling the binary data just fine.
update: added binmode G;. example was only working without it because i'm a linux weenie?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Mp3 PLayer. Part Two!
by grantm (Parson) on Sep 20, 2002 at 01:32 UTC | |
|
Re: Re: Mp3 PLayer. Part Two!
by BUU (Prior) on Sep 20, 2002 at 02:01 UTC | |
by Mr. Muskrat (Canon) on Sep 20, 2002 at 14:38 UTC |