newbit板载一个蜂鸣器可以唱歌可以说英语(机器式),有趣。导入模块
简单使用
- import speech
- from microbit import sleep
- while True:
- speech.say("I love eeworld")
- sleep(1000)
听听机器发说的英语 i love eeworld
[media]https://m.eeworld.com.cn/bbs/forum.php?mod=attachment&aid=MjkyNDQ0fDg4Y2Q2NzlkOWVkOWUzNDk2NmRhMGMzYmY4MzgxY2I3fDE3MzI0NTIzMzY%3D&request=yes&_f=.mp3[/media]
speech的函数:
- speech.say("I am a little robot", speed=92, pitch=60, throat=190, mouth=190)
- speech.say("I am an elf", speed=72, pitch=64, throat=110, mouth=160)
- speech.say("I am a news presenter", speed=82, pitch=72, throat=110, mouth=105)
- speech.say("I am an old lady", speed=82, pitch=32, throat=145, mouth=145)
- speech.say("I am E.T.", speed=100, pitch=64, throat=150, mouth=200)
- speech.say("I am a DALEK - EXTERMINATE", speed=120, pitch=100, throat=100, mouth=200)
此内容由EEWORLD论坛网友ihalin原创,如需转载或用于商业用途需征得作者同意并注明出处