php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21852 Propput() fail on COM object (MS SAPI 5.1 TTS Voice Property)
Submitted: 2003-01-23 19:40 UTC Modified: 2003-01-25 11:51 UTC
From: londajm at rcn dot com Assigned:
Status: Not a bug Package: COM related
PHP Version: 4.3.0 OS: W2K
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: londajm at rcn dot com
New email:
PHP Version: OS:

 

 [2003-01-23 19:40 UTC] londajm at rcn dot com
I am not sure if this is a PHP bug or my inexperience with MS SAPI 5.1, but I saw a similiar problem (ID 15205) that was not resolved. I am using PHP 4.3/Apache 2.0.43/W2K and I can not set the Voice property with an object variable. 

THE CODE:

// This instantiates the object
$VoiceObj = new COM("SAPI.SpVoice") or die("Unable to instantiate SAPI");

// Gets the available voices and prints them
$VoicesToken=$VoiceObj->GetVoices();
$NumberofVoices=$VoicesToken->Count;
For ($i=0;$i<$NumberofVoices;$i++)
{
   $VoiceToken=$VoicesToken->Item($i);
  $VoiceName[$i]=$VoiceToken->GetDescription();
  print "$VoiceName[$i]................Item Number: $i </br>";
}

// Gets and prints the id of the specified voice
$SelectedVoiceToken=$VoicesToken->Item(1);
$SelectedVoiceTokenid=$SelectedVoiceToken->id;
print "$SelectedVoiceTokenid</br>";

// Tries to SET the voice (but fails)
$VoiceObj->Voice=$SelectedVoiceToken;
$VoiceName=$VoiceObj->Voice->GetDescription();
print "$VoiceName</br>";

// This changes the rate of the selected voice
$VoiceObj->Rate = "0";

$VoiceObj->Speak("Hello, welcome to my website");

unset($VoiceObj);

THE RESULTS:

Microsoft Mary................Item Number: 0
ATT DTNV 1.3 Crystal16................Item Number: 1
ATT DTNV 1.3 Mike................Item Number: 2
LH Michael................Item Number: 3
LH Michelle................Item Number: 4
ATT DTNV 1.3 Crystal................Item Number: 5
Microsoft Mike................Item Number: 6
Microsoft Sam................Item Number: 7
Sample TTS Voice................Item Number: 8
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\ATT-DT-13-Crystal16

Warning: main(): PropPut() failed: Member not found. in C:\talk.php on line59

Microsoft Mary



Joe Londa

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-25 11:51 UTC] phanto@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

this is not a php issue.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 11 18:03:36 2022 UTC