⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 027-animalsounds.py

📁 this code is used for edit on os of s60
💻 PY
字号:
import appuifw, audioanimals = [u'dog', u'cat', u'cow']def record_animal_sounds():    for animal in animals:        noise = audio.Sound.open('e:\\' + animal + '.wav')        if appuifw.query(u"Record sound of a " + animal, "query"):            noise.record()            appuifw.query(u"Press OK to stop recording", "query")            noise.stop()            noise.close()def select_sound():    global funny_noise    funny_noise = None    while True:        index = appuifw.popup_menu(animals, u"Select sound:")        if funny_noise:            funny_noise.stop()        if index == None:            break        else:            play_animal_sound(u'e:\\' + animals[index] + '.wav')def play_animal_sound(soundfile):    global funny_noise    funny_noise = audio.Sound.open(soundfile)    funny_noise.play()    record_animal_sounds()select_sound()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -