|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
恰恰证明了java的简单,要不怎么没有通过c/c++来搞个这种框架?要做语音,查了一些材料。
JavaSpeechAPI:http://java.sun.com/products/java-media/speech/
JavaSpeechAPI同意开辟职员将语音手艺整合到Javaapplet和使用程序的用户界面中。这类API划定一个跨平台的接口来撑持命令―把持辨认器、听写体系和语音分解器。
这个综合API被分红几个标准:
JavaSpeechAPI标准(JavaSpeechAPISpecification,JSAPI)
JavaSpeechAPI程序员指南
JavaSpeechAPI语法格局标准(JavaSpeechAPIGrammarFormatSpecification,JSGF)
JavaSpeechAPI标志言语标准(JavaSpeechAPIMarkupLanguageSpecification,JSML)
这个API没有Sun公司的参考完成,可是有很多第三方完成,包含SpeechforJava(能够从IBMalphaWorks取得),它利用ViaVoice来撑持语音命令辨认、听写和文本到语音的分解。
java.sun.com官方材料:
QuestionIndex
WherecanIgettheJavaSpeechAPI(JSAPI)?
TheJavaSpeechAPI(JSAPI)isnotpartoftheJDKandSundoesnotshipanimplementationofJSAPI.Instead,weworkwiththirdpartyspeechcompaniestoencouragetheavailabilityofmultipleimplementations.
QuestionIndex
WhatistheJavaSpeechAPI(JSAPI)?
TheJavaSpeechAPIallowsJavaapplicationstoincorporatespeechtechnologyintotheiruserinterfaces.Itdefinesacross-platformAPItosupportcommandandcontrolrecognizers,dictationsystemsandspeechsynthesizers.
QuestionIndex
WhenwilltheJSAPIspecificationbeavailable?
TheJavaSpeech1.0APIspecificationwasreleasedonOctober26,1998,andisavailableathttp://java.sun.com/products/java-media/speech/
QuestionIndex
WhatdoestheJavaSpeechAPIspecificationinclude?
TheJavaSpeechAPIspecificationincludestheJavadoc-styleAPIdocumentationfortheapproximately70classesandinterfacesintheAPI.ThespecificationalsoincludesadetailedProgrammersGuidewhichexplainsbothintroductoryandadvancedspeechapplicationprogrammingwithJSAPI.Twocompanionspecificationsareavailable:JSMLandJSGF.
Thespecificationisnotyetprovidedwiththe.classfilesneededtocompileapplicationswithJSAPI.
QuestionIndex
WhatareJSMLandJSGF?
TheJavaSpeechAPIMarkupLanguage(JSML)andtheJavaSpeechAPIGrammarFormat(JSGF)arecompanionspecificationstotheJavaSpeechAPI.JSML(currentlyinbeta)definesastandardtextformatformarkinguptextforinputtoaspeechsynthesizer.JSGFversion1.0definesastandardtextformatforprovidingagrammartoaspeechrecognizer.Bothspecificationsareavailableathttp://java.sun.com/products/java-media/speech/
QuestionIndex
HowwastheJSAPIspecificationdeveloped?
SunMicrosystems,Inc.workedinpartnershipwithleadingspeechtechnologycompaniestodefinetheinitialspecificationoftheJavaSpeechAPI,JSMLandJSGF.Sunisgratefulforthecontributionsof:
AppleComputer,Inc.
AT&T
DragonSystems,Inc.
IBMCorporation
Novell,Inc.
PhilipsSpeechProcessing
TexasInstrumentsIncorporated
TheJSAPIspecificationandJSGFandJSMLspecificationsweredevelopedasopenspecificationswithinputfromapublicreviewprocess.
QuestionIndex
HowdoesJSAPIrelatetootherJavaAPIs?
TheJavaSpeechAPIispartofafamilyofAPIsthatworktogetherasasuitetoprovidecustomerswithenhancedgraphicsandextendedcommunicationscapabilities.TheseAPIsincludethe
Java2DAPI
Java3DAPI
JavaAdvancedImagingAPI
JavaMediaFrameworkAPI
JavaSoundAPI
JavaTelephonyAPI
QuestionIndex
WhatJSAPIimplementationsarenowavailable?
TheJavaSpeechAPIisafreelyavailablespecificationandthereforeanyoneiswelcometodevelopanimplementation.Thefollowingimplementationsareknowntoexist.
Note:SunMicrosystems,Inc.makesnorepresentationsorwarrantiesaboutthesuitabilityofthesoftwarelistedhere,eitherexpressorimplied,includingbutnotlimitedtotheimpliedwarrantiesofmechantability,fitnessforaparticularpurpose,ornon-infringement.TheimplementationslistedherehavenotbeentestedwithregardtocompliancetotheJSAPIspecification,nordoestheirappearanceonthispageimplyanyformofendorsementofcomplianceonthepartofSun.
FreeTTSon
Description:OpensourcespeechsynthesizerwrittenentirelyintheJavaprogramminglanguage.
Requirements:JDK1.4.ReadaboutmorerequirementsontheFreeTTSwebsite.
IBMs"SpeechforJava"
Description:ImplementationbasedonIBMsViaVoiceproduct,whichsupportscontinuousdictation,commandandcontrolandspeechsynthesis.ItsupportsalltheEuropeanlanguageversionsofViaVoice--US&UKEnglish,French,German,ItalianandSpanish--plusJapanese.
Requirements:JDK1.1.7orlaterorJDK1.2onWindows95with32MB,orWindowsNTwith48MB.BothplatformsalsorequireaninstallationViaVoice98.
IBMs"SpeechforJava"onLinux
Description:Betaversionof"SpeechforJava"onLinux.Currentlyonlysupportsspeechrecognition.
Requirements:RedHatLinux6.0with32MB,andBlackdownJDK1.1.7withnativethreadsupport.
TheCloudGarden
Description:Implementationforusewithanyrecognition/TTSspeechenginecompliantwithMicrosoftsSAPI5(withSAPI4supportforTTSenginesonly).Anadditionalpackageallowsredirectionofaudiodatato/fromFiles,Linesandremoteclients(usingthejavax.sound.sampledpackage).SomeexamplesdemonstrateitsuseinappletsinNetscapeandIEbrowsers.
Requirements:JDK1.1orbetter,Windows98,Me,2000orNT,andanySAPI5.1,5.0or4.0compliantspeechengine(someofwhichcanbedownloadedfromMicrosoftswebsite).
Lernout&HauspiesTTSforJavaSpeechAPI
Description:ImplementationsbaseduponASR1600andTTS3000engines,whichsupportcommandandcontrolandspeechsynthesis.Supports10differentvoicesandassociatedwhisperingvoicesfortheEnglishlanguage.Providescontrolforpitch,pitchrange,speakingrate,andvolume.
Requirements:SunSolarisOSversion2.4orlater,JDK1.1.5.SunSwingpackage(freedownload)forgraphicalType-n-Talkdemo.
Moreinformation:ContactEdmundKwan,DirectorofSales,WesternRegionSpeechandLanguageTechnologiesandSolutions(ekwan@lhs.com)
ConversaWeb3.0
Description:ConversaWebisavoice-enabledWebbrowserthatprovidesarangeoffacilitiesforvoice-navigationofthewebbyspeechrecognitionandtext-to-speech.ThedevelopersofConversaWebchosetowriteaJSAPIimplementationforthespeechsupport.
Requirements:Windows95/98orNT4.0runningonIntelPentium166MHzprocessororfaster(orequivalent).Minimumof32MBRAM(64MBrecommended).Multimediasystem:soundcardandspeakers.MicrosoftInternetExplorer4.0orhigher.
Festival
Description:Festivalisageneralmulti-lingualspeechsynthesissystemdevelopedbytheCentreforSpeechTechnologyResearchattheUniversityofEdinburgh.ItoffersafulltexttospeechsystemwithvariousAPIs,aswellanenvironmentfordevelopmentandresearchofspeechsynthesistechniques.ItiswritteninC++withaScheme-basedcommandinterpreterforgeneralcontrolandprovidesabindingtotheJavaSpeechAPI.SupportstheEnglish(BritishandAmerican),SpanishandWelshlanguages.
Requirements:FestivalrunsonSuns(SunOSandSolaris),FreeBSD,Linux,SGIs,HPsandDECAlphasandisportabletootherUnixmachines.PreliminarysupportisavailableforWindows95andNT.FordetailsandrequirementsseetheFestivaldownloadpage.
ElanSpeechCube
Description:ElanSpeechCubeisaMultilingual,multichannel,cross-operatingsystemtext-to-speechsoftwarecomponentforclient-serverarchitecture.SpeechCubeisavailablewith2TTStechnologies(ElanTempo:diphoneconcatenationandElanSayso:unitselection),covering11languages.SpeechCubenativeJavaclientsupportsJSAPI/JSML.
Requirements:JDK1.3orlateronWindowsNT/2000/XP,LinuxorSolaris2.7/2.8,SpeechCubeV4.2andhigher.
AboutElanSpeech:ElanSpeechisanestablishedworldwideprovideroftext-to-speechtechnology(TTS).ElanTTStransformsanyITgeneratedtextintospeechandreadsitoutloud.
QuestionIndex
HowdoIuseJSAPIinanapplet?
ItispossibletouseJSAPIinanapplet.Inordertodothis,userswillneedtheJavaPlug-in(seehttp://java.sun.com/products/plugin).ThereasonforthisisthatJSAPIimplementationsrequireaccesstotheAWTEventQueue,andthebuilt-inJDKsupportinthebrowsersweveworkedwithdeniesanyappletaccesstotheAWTEventQueue.TheJavaPlug-indoesnthavethisrestriction,anduserscanconfiguretheJavaPlug-intograntordenyappletaccesstotheAWTQueue.
IfyouareusingJRE1.1:
HaveyourusersfollowthesestepsifyourappletisbaseduponJDK1.1:
ObtainaJDK1.1.7orbetterJavaRuntimeEnvironment(JRE).ThereasonforthisiswehavehadproblemswithappletsecuritybeingdeniedwithJDK1.1.6.PleasenotethattheuserneedstheJREandnottheJDK.TheJREisfreelyavailablefordownloadfromthefollowingURL:
http://java.sun.com/products/jdk/1.1
Beforerunningthebrowser,havetheusermodifytheirCLASSPATHenvironmentvariabletoincludethesupportingclassesforJSAPI.Forexample,iftheuserhasIBMsSpeechforJava,havetheuserincludetheibmjs.jarfileinCLASSPATH.
MakesureanysharedlibrariesfortheJSAPIsupportareintheusersPATH.Forexample,iftheuserhasIBMsSpeechForJava,havetheuserincludetheibmjslibdirectoryintheirPATH(e.g.,c:ibmjslib).
Havetheusercopythespeech.propertiestotheirhomedirectory.AusercandeterminetheirhomedirectorybyenablingtheconsolefortheJavaPlug-in.WhentheuseraccessesapagethatusestheJavaPlug-in,theJavaPlug-inconsolewilltelltheuserwhatitthinkstheusershomedirectoryis.
Usejavakeytoaddyouridentitytotheirsignaturedatabase(i.e.,identitydb.obj).ThiswilltelltheJavaPlug-intotrustappletssignedbyyou.InformationonjavakeyandsigningcanbefoundatthefollowingURLS:
http://java.sun.com/security/signExample
http://java.sun.com/products/plugin/1.1.1/signed.html
Copytheidentitydb.objthatwascreatedorupdatedinprevioussteptotheusershomedirectory(thesameplacewheretheusercopiedspeech.properties).
Thenperformthesestepsonyourapplet:
Usejavakeytobothcreateasignaturedatabaseforyoursystemandtosignyourappletsjarfile.Thiswillallowtheapplettoparticipateinthesecuritymodel.
CreateanHTMLpagethatusesyourappletinthePlug-in.Seehttp://java.sun.com/products/plugin/1.1.1/docsformoreinformationonhowtodothis.
Iftheuserexperiencesa"checkread"exceptionwhileattemptingtorunyourapplet,itsmostlikelyduetoamismatchbetweentheusersidentitydb.objfileandthesignatureonyourappletsjarfile.Awaytoremedythisistorecreateyouridentitydb.objandre-signyourjarfile.
IfyouareusingJRE1.2:
TheJava2platformssecuritymodelallowssigningasdonewithJDK1.1,butitalsopermitsfinergrainedaccesscontrol.Thefollowingarejustsomeexamples,andwerecommendyoureadtheJavaSecurityArchitectureSpecificationatthefollowingURLbeforedecidingwhattodo:
http://java.sun.com/products/jdk/1.2/docs/guide/security/spec/security-spec.doc.html
Foraquickstart,haveyourusersdothefollowingifyourappletusestheJava2(i.e.,JDK1.2)platform:
ObtaintheJDK1.2Plug-in.
Beforerunningthebrowser,havetheusermodifytheirCLASSPATHenvironmentvariabletoincludethesupportingclassesforJSAPI.Forexample,iftheuserhasIBMsSpeechforJava,havetheuserincludetheibmjs.jarfileinCLASSPATH.
MakesureanysharedlibrariesfortheJSAPIsupportareintheusersPATH.Forexample,iftheuserhasIBMsSpeechForJava,havetheuserincludetheibmjslibdirectoryintheirPATH(e.g.,c:ibmjslib).
Havetheusercopythespeech.propertiestotheirhomedirectory.AusercandeterminetheirhomedirectorybyenablingtheconsolefortheJavaPlug-in.WhentheuseraccessesapagethatusestheJavaPlug-in,theJavaPlug-inconsolewilltelltheuserwhatitthinkstheusershomedirectoryis.
Havetheusermodifytheirjava.policyfileintheJavaPlug-inssecuritydirectoryappropriately.Therearemanywaystodothis.Thefollowingarejustafewpossibilities:
GrantallappletstheAllPermissionproperty.Thisisextremelydangerousandisonlyprovidedasanexample.Todothis,havetheusermodifytheirjava.policyfiletocontainonlythefollowinglines:
grant{
permissionjava.security.AllPermission;
}
GrantpermissionstoaparticularURL(e.g.,theURLcontainingyourapplet).Todothis,havetheuseraddthefollowinglinestotheirjava.policyfile:
grantcodeBase"http://your.url.here"{
permissionjava.security.AllPermission;
}
TheinformationinthisFAQisnotmeanttobeacompletetutorialontheJDK1.1andJDK1.2architecture.Instead,itismeanttobehopefullyenoughtogetyoustartedwithrunningJSAPIappletsinabrowser.WesuggestyouvisitthefollowingURLstoobtainmoreinformationontheJavaSecuritymodels:
JavaSecurityHomePage:
http://java.sun.com/security
TutorialonJDK1.1Security:
http://java.sun.com/docs/books/tutorial/security1.1
TutorialonJDK1.2Security:
http://java.sun.com/docs/books/tutorial/security1.2
QuestionIndex
WhydoesNetscapeNavigatororInternetExplorerthrowasecurityexceptionwhenIuseJSAPIinanapplet?
JSAPIimplementationsrequireaccesstotheAWTEventQueue.Thebuilt-inJavaplatformsupportinthebrowsersweveworkedwithdeniesanappletaccesstotheAWTEventQueue.Asaresult,JSAPIimplementationswillbedeniedaccesstotheAWTEventQueue.Inaddition,wearenotawareofawaytoconfigurethebuilt-inJavaplatformsupportintheseenvironmentstoallowaccesstotheAWTEventQueue.
TheJavaPlug-in(seehttp://java.sun.com/products/plugin),however,canbeconfiguredtoallowanappletthenecessarypermissionsitneedstouseanimplementationofJSAPI.Asaresult,wecurrentlyrecommendusingtheJavaPlug-inforappletsthatuseJSAPI.
QuestionIndex
ImconcernedaboutJSAPIapplets"bugging"myoffice.WhataretheplansforJSAPIandsecurityonJDK1.2?
TheJSAPI1.0specificationincludestheSpeechPermissionclassthatcurrentlyonlysupportsoneSpeechPermission:javax.speech.Whenthatpermissionisgranted,anapplicationorapplethasaccesstoallthecapabilitiesprovidedbyinstalledspeechrecognizersandsynthesizers.Withoutthatpermission,anapplicationorapplethasnoaccesstospeechcapabilities.
Asspeechtechnologymaturesitisanticipatedthatafiner-grainedpermissionmodelwillbeintroducedtoprovideaccessbyapplicationsandappletstosome,butnotall,speechcapabilities.
Beforegrantingspeechpermission,developersandusersshouldconsiderthepotentialimpactofthegrant.
QuestionIndex
DoesJSAPIallowmetocontroltheaudioinputsourceofarecognizerorredirecttheaudiooutputofaspeechsynthesizer?
ThissupportiscurrentlynotinJSAPI.WeplantousetheJavaSoundAPItohelpprovidethissupportinthefuture.Wepurposelyleftroomforexpansioninthejavax.speech.AudioManagerinterfaceandwillfurtherinvestigatethissupportaftertheJavaSoundAPIisfinalized.
QuestionIndex
试用了一些产物,发明关于中文不可呀,那位先容一下呀?
而学习JAVA我觉得最应该避免的就是:只学习,不思考,只记忆,不实践! |
|