RES: PHP Speech

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



{Top Posting}

I don't know if I'm just lazy or stupid (or both).

I went into a similar issue few weeks ago and my solution was to add a
function to delete files created in the last X hours (mine was 24), and call
it on the same script that creates the files.

Which means it tries to clean up old files every time it creates a new one.

Is that any good for you guys?


Regards,
Thiago

-----Mensagem original-----
De: Daniel Brown [mailto:parasane@xxxxxxxxx] 
Enviada em: terça-feira, 15 de abril de 2008 21:05
Para: tedd
Cc: php-general@xxxxxxxxxxxxx
Assunto: Re:  PHP Speech

On Tue, Apr 15, 2008 at 7:04 PM, tedd <tedd.sperling@xxxxxxxxx> wrote:
>
>  Your hosting service provides the capability to turn html text to 
> speech, as I've done here:
[snip!]
>
>  But, how do we delete the file? The php script is history after 
> presenting the page and javascript can't touch the server, right? So, 
> how does one delete the wave file?
>
>  The only way I can see is to set up a cron job to delete all wave 
> files after a certain time, but that's kind-of lame. Is there 
another way?

    Right, but unfortunately, because it's audio that needs to 
stream, it can't just be served like an image (think GD or 
imagemagick) and then destroyed.  There is no way to know how 
long it will be before the client receives the entire file, and 
it would prove to be too much to store in a reasonable buffer.

    That's why I had to write it the way it is.  The drawback 
is that, yes, unless you're overwriting the file each time 
(which, with high-traffic sites, would corrupt larger files 
mid-download), you either have to have a script to unlink() the 
files or a cron to remove them (or resort to a manual removal).

    I'm all ears, eyes, and cerebellum if you've got an idea on 
how to fix that though.  The next phase should have better 
speech, I'm just having a tough time with paid gigs now and 
find no time to focus on the fun stuff really.  I still don't 
know why no one ever told us the truth that, no matter how much 
we wanted to be Toys 'R' Us kids, the answer was unscrupulously 
the same: tough nuts.

--
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ 
$19.99/mo., and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, 
visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux