php-general Digest 30 Nov 2008 11:26:24 -0000 Issue 5818

Topics (messages 283918 through 283924):

Re: operators as callbacks?
        283918 by: Nathan Nobbe
        283921 by: Martin ZvarĂ­k

Text To Speech Update
        283919 by: Daniel P. Brown
        283920 by: Nathan Nobbe
        283922 by: Michael Kubler

Re: Something to lighten the mood...
        283923 by: Richard Heyes
        283924 by: Richard Heyes

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Sat, Nov 29, 2008 at 2:42 PM, Joe <[EMAIL PROTECTED]> wrote:

> Is it possible to use a PHP operator as a callback?


not that im aware of, even if you use the operator overloading extension, im
not sure youll find that ability.

I can use the BC library's math functions instead:
>  array_map('bcadd', $array1, $array2)
> but that is an ugly hack that might break if the library is not available.


 i dont know how bad that is really, i guess it depends on the distribution
scope of the application.  if its in a controlled environment, id just say
install bcmath and forget it.

I can create an anonymous function:
>  array_map(create_function('$a, $b', 'return $a + $b;'), $array1, $array2)
> but that seems really unnecessarily verbose.


well, youll just have to wait for 5.3 and its new lambda notation, youll be
able to do this (something close anyway :)),

array_map(function($a, $b) { return $a + $b; }, $array1, $array2);

it doesnt look like much difference here, but create_function() gets a lot
worse w/ functions any less trivial than adding 2 numbers.

Is there any simple clean way to do it? Thanks,


i think youre beating your head against the wall for no good reason.  your
solutions are fine, just pick one and roll w/ it ;)

-nathan

--- End Message ---
--- Begin Message ---
Joe napsal(a):
Is it possible to use a PHP operator as a callback? Suppose I want to add two
arrays elementwise, I want to be able to do something like this:
 array_map('+', $array1, $array2)
but this doesn't work as "+" is an operator and not a function.

I can use the BC library's math functions instead:
 array_map('bcadd', $array1, $array2)
but that is an ugly hack that might break if the library is not available.

I can create an anonymous function:
 array_map(create_function('$a, $b', 'return $a + $b;'), $array1, $array2)
but that seems really unnecessarily verbose.

Is there any simple clean way to do it? Thanks,



array_sum() ?

--- End Message ---
--- Begin Message ---
    Any/All:

    For those of you who were asking about the PHP Text-To-Speech
system I had running, it's back online now.  If you have a few free
seconds, please take a look at http://www.pilotpig.net/txt2wav.php and
let me know if it's working for sure in your browser and on your OS.

    With a bit more time being available to devote to non-paid
projects, and hopefully getting a bit better still in the next week or
so, I've had time to be able to work more with the PHP project and the
PHP-VOX.  When I make enough improvements to the installation routines
so that folks can easily do it on their own servers, I'll have the
source available for download.

    Thanks, everyone.  Hope you're all enjoying the weekend.

-- 
</Daniel P. Brown>
http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
50% Off Hosting! http://www.pilotpig.net/specials.php

--- End Message ---
--- Begin Message ---
On Sat, Nov 29, 2008 at 5:21 PM, Daniel P. Brown
<[EMAIL PROTECTED]>wrote:

>    Any/All:
>
>    For those of you who were asking about the PHP Text-To-Speech
> system I had running, it's back online now.  If you have a few free
> seconds, please take a look at http://www.pilotpig.net/txt2wav.php and
> let me know if it's working for sure in your browser and on your OS.
>
>    With a bit more time being available to devote to non-paid
> projects, and hopefully getting a bit better still in the next week or
> so, I've had time to be able to work more with the PHP project and the
> PHP-VOX.  When I make enough improvements to the installation routines
> so that folks can easily do it on their own servers, I'll have the
> source available for download.
>
>    Thanks, everyone.  Hope you're all enjoying the weekend.


kick-ass dan, i cant wait until the source is out there :D

-nathan

--- End Message ---
--- Begin Message --- Works ok for me on FFox v2 and v3 on my Windows XP machines, but when trying it on IE v6.0 the speech is played back REALLY fast. Like super chipmunk style. I tried a duration of 5.5, but that mainly just made the pauses between the words longer, but was still very high pitched and fast.

Also, it's really annoying that the text that I just typed in to test disappears. I HATE it when websites forget what I just input, and when writing scripts I hate loosing or throwing away user input.

But still, good work on the VOX, too bad all text to speech synthesisers I've used sound like a computer. My Dad blurted out when I first went to your site 'Ohh I was playing with text to speech 30 years ago.'

I can see things like this being a big plus for usability.

Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>



Nathan Nobbe wrote:
On Sat, Nov 29, 2008 at 5:21 PM, Daniel P. Brown
<[EMAIL PROTECTED]>wrote:

   Any/All:

   For those of you who were asking about the PHP Text-To-Speech
system I had running, it's back online now.  If you have a few free
seconds, please take a look at http://www.pilotpig.net/txt2wav.php and
let me know if it's working for sure in your browser and on your OS.

   With a bit more time being available to devote to non-paid
projects, and hopefully getting a bit better still in the next week or
so, I've had time to be able to work more with the PHP project and the
PHP-VOX.  When I make enough improvements to the installation routines
so that folks can easily do it on their own servers, I'll have the
source available for download.

   Thanks, everyone.  Hope you're all enjoying the weekend.


kick-ass dan, i cant wait until the source is out there :D

-nathan


--- End Message ---
--- Begin Message ---
>    And here, when you said 'RBH' the first time, I thought you knew
> Richard's middle name.

bh == Benson & Hedges

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 29th)

--- End Message ---
--- Begin Message ---
> tbh I'm most impressed with your remote php-general-list mood detection
> script - how did you know?

Sorry, no idea what you're talking about. I take there's been a heated
(read: fun) discussion recently?

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 29th)

--- End Message ---

Reply via email to