zl程序教程

您现在的位置是:首页 >  后端

当前栏目

我的Go+语言初体验——【三、spx案例测试_许式伟先生推荐补充(附-视频)】

Go案例测试语言 视频 推荐 补充 初体验
2023-09-14 09:04:58 时间

欢迎大家参与【我的Go+语言初体验】活动:

活动地址:【https://bbs.csdn.net/topics/603464006?utm_source=1594742339

安装过程博文:【我的Go+语言初体验——goplus环境问题锦集(一)_红目香薰-CSDN博客

安装过程视频:【GoPlus_Win10_红目香薰-CSDN直播

专栏路径:【https://blog.csdn.net/feng8403000/category_11496375.html

视频地址:【https://live.csdn.net/v/181609

B站地址:【https://www.bilibili.com/video/BV1i3411b7Nj/

本课程根据【许式伟】先生的指点说明,向大家推荐【tutorial】下的【Demo】,此类demo会对大家掌握【Go+的spx】会有很大的帮助。

目录

欢迎大家参与【我的Go+语言初体验】活动:

1、拉取【spx】测试内容

2、【tutorial】下的【Demo】运行

案例一、聊天气

3、编码分析

Jaime的对白编码:

kai的对白编码:

生成的【gop_autogen.go】文件分析


1、拉取【spx】测试内容

前置环境需要有【git】

git clone https://github.com/goplus/spx.git

拉取完成后请关闭当前【cmd】,无法再这个【cmd】内执行测试。

可能偶尔出现拉取失败,重试即可。

2、【tutorial】下的【Demo】运行

案例一、聊天气

3、编码分析

这个调用的是网络包看着名字是【七牛】的,也就是B栈那个。

七牛云的B栈主页:【七牛云的个人空间_哔哩哔哩_Bilibili】 

Jaime的对白编码:

onMsg "1", => {
	play recordingComeFrom
	say "I come from England.", 2
	broadcast "2"
}

onMsg "3", => {
	play recordingMild
	say "It's mild, but it's not always pleasant.", 4
	nextCostume
	play recordingEast
	say "The weather's often cold in the North and windy in the East.", 5.5
	play recordingSouth
	say "It's often wet in the West and sometimes warm in the South.", 5
	broadcast "4"
}

onMsg "5", => {
	nextCostume
	play recordingSummer
	say "I like spring and summer.", 2
	play recordingShort
	say "The days are long and the nights are short.", 3
	play recordingLate
	say "The sun rises early and sets late. ", 3
	nextCostume
	play recordingWinter
	say "I don't like autumn and winter.", 3
	play recordingLong
	say "The days are short and the nights are long.", 4
	play recordingEarly
	say "The sun rises late and sets early.", 4
	nextCostume
	play recordingInteresting
	say "Our climate is not very good, but it's certainly interesting.", 5
	play recordingConversation
	say "It's our favourite subject of conversation.", 4
	broadcast "6"
}

onMsg "7", => {
	play recordingBye
	say "Bye!", 2
	nextCostume
}

kai的对白编码:

onStart => {
	setCostume "kai-a"
	play recordingWhere
	say "Where do you come from?", 2
	broadcast "1"
}

onMsg "2", => {
	play recordingCountry
	say "What's the climate like in your country?", 3
	broadcast "3"
}

onMsg "4", => {
	play recordingBest
	say "Which seasons do you like best?", 3
	broadcast "5"
}

onMsg "6", => {
	play recordingBye2
	say "Thanks. Bye!", 2
	nextCostume
	broadcast "7"
}

生成的【gop_autogen.go】文件分析

 

后面的对白就是写死的了:

应该是为了让咱们更好理解吧,很直接。不过我还找到开启多线程的文档。

声音是在线生成的,不知道里面怎么调用的。