Facebook Sharer
选择您要替换的背景颜色:
【农历新年】背景图片:
个性化设定
 注册  找回密码
查看: 1430|回复: 6
打印 上一主题 下一主题

【疑问】SAPI 的 volume 和 interval

[复制链接]

2

主题

0

好友

184

积分

高级会员

Rank: 3Rank: 3Rank: 3

跳转到指定楼层
1#
发表于 2010-5-1 08:05 PM |只看该作者 |正序浏览
这个是 code

  1. Public Class Form1

  2.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim SAPI
  4.         SAPI = CreateObject("sapi.spvoice")
  5.         SAPI.speak(RichTextBox1.Text)
  6.     End Sub
  7. End Class
复制代码
然后 , 疑问是怎么调 volume 和 interval 呢?
找了 Google 找不到

本来放了

  1. SAPI.voice.interval = 350
复制代码
然后下面没有出红线

debug 后
到这段时
就 highlight 起来了




收藏收藏0

2

主题

0

好友

184

积分

高级会员

Rank: 3Rank: 3Rank: 3

7#
发表于 2010-5-2 12:17 PM |只看该作者
@番茄大人
好的 , 我试试

@松哥
那次是随便看到的 , 随意随便 try try ==


回复

使用道具 举报

62

主题

5

好友

3715

积分

本站名嘴

Rank: 11Rank: 11

6#
发表于 2010-5-2 10:35 AM |只看该作者
我说你啊,用华文的VisualBasic比较好,上次他问我为什么这个Code不可以
msgbox("message",msgboxstyle.information("title"))


回复

使用道具 举报

7

主题

1

好友

5108

积分

一流名嘴

Rank: 12Rank: 12Rank: 12

5#
发表于 2010-5-2 03:59 AM |只看该作者
换了 code
button1 正常

button2 还是 error 在
spvoice.volume
error 说 volume 在 boolean 找不到
maple迷 发表于 2010-5-1 10:01 PM



spvoice.volume = TextBox1.Text

應該是資料型態問題, documentation 中已經說明需賦予 Long 型態


Volume Property

The Volume property gets and sets the base volume (loudness) level of the voice.
Values for the Volume property range from 0 to 100, representing the minimum and maximum volume levels, respectively.
At the beginning of each Speak or SpeakStream method, the voice sets the volume level according to the value of the Volume property, and speaks the entire stream at that level. The voice's Volume property can be changed at any time, but the actual volume level will not reflect the changed property value until it begins a new stream.Syntax
Set:SpVoice.Volume = Long
Get:Long = SpVoice.Volume
PartsSpVoiceThe owning object.LongSet:   A Long variable that sets the property value.
Get:   A Long variable that gets the property value.


回复

使用道具 举报

2

主题

0

好友

184

积分

高级会员

Rank: 3Rank: 3Rank: 3

4#
发表于 2010-5-1 10:01 PM |只看该作者

  1. Public Class Form1

  2.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim Spvoice
  4.         Spvoice = CreateObject("sapi.spvoice")
  5.         Spvoice.speak(RichTextBox1.Text)
  6.     End Sub

  7.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  8.         Dim spvoice
  9.         spvoice = Created
  10.         spvoice.volume = TextBox1.Text
  11.     End Sub
  12. End Class
复制代码
换了 code
button1 正常

button2 还是 error 在
spvoice.volume
error 说 volume 在 boolean 找不到


回复

使用道具 举报

2

主题

0

好友

184

积分

高级会员

Rank: 3Rank: 3Rank: 3

3#
发表于 2010-5-1 09:46 PM |只看该作者
谢谢番茄大大
这个网址很有帮助
___________________________________

如果直接用 dim 和用 import 会有不同吗?


回复

使用道具 举报

7

主题

1

好友

5108

积分

一流名嘴

Rank: 12Rank: 12Rank: 12

2#
发表于 2010-5-1 08:56 PM |只看该作者
这个是 code然后 , 疑问是怎么调 volume 和 interval 呢?
找了 Google 找不到

本来放了然后下面没有出 ...
maple迷 发表于 2010-5-1 08:05 PM



學習前應該看看有哪些属性和函数可以讓你使用及說明
http://msdn.microsoft.com/en-us/library/ms723602%28VS.85%29.aspx


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-10-25 07:34 PM , Processed in 0.098960 second(s), 29 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Ultra High-performance Dedicated Server powered by iCore Technology Sdn. Bhd.
Domain Registration | Web Hosting | Email Hosting | Forum Hosting | ECShop Hosting | Dedicated Server | Colocation Services
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部