中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-09 23:45
47,811 主题排行 / 349,897 发帖 / 今日 2 篇 / 48,255 会员排行
DOS批处理 & 脚本技术(批处理室) » 如何让一个批处理鸣唱?
可打印版本  1,775 / 15
第1楼 uiopuiop 发表于 2008-09-24 22:36
中级用户 发帖 211 积分 400
如何让一个批处理鸣唱?
有没有什么办法让一个批处理读取一个文本文件,然后“鸣唱”?

类似与汇编编写的音乐一样。

http://zhidao.baidu.com/question/28984103.html?fr=qrl

本人作品见三楼,多多指教。。。

[ Last edited by uiopuiop on 2008-9-25 at 07:39 PM ]
第2楼 tireless 发表于 2008-09-24 22:48
银牌会员 发帖 1,122 积分 2,025
可以鸣叫,可以说话,唱歌...
第3楼 uiopuiop 发表于 2008-09-24 23:02
中级用户 发帖 211 积分 400
JAMES BOND -- 007主题曲
JAMES BOND 主题曲, 已经更新,完整版本看附件,化了我一晚上敲键盘打出来的。。。。。吹牛ING)

看到KIX 的脚本可以做到,不知道有没有其他更容易的办法。
如果有软件能将一个MP3转换成这些字符串就好了。

WKIX32.EXE play.kix

play.kix (JAMES BOND 主题曲)
-----------------------------------------------------------
PLAY "0g256t 0g8d247f 4d165f 247f 8d262f 4d165f 262f 8d277f 4d165f
277f 8d262f 4d165f 262f 8d247f 4d165f 247f 8d262f 4d165f
262f 8d277f 4d165f 277f 8d262f"
-------------------------------------------------------------
The string or file consists of a sequence of commands indicating the frequency and duration of the tones to play. The following commands are available:
• F or f - frequency
This command causes a tone to be produced at the current frequency. The initial current frequency is 1000Hz. To change the value, indicate the desired frequency immediately followed by the f character. For example, to produce a tone at 1500Hz, specify 1500F.
• G or g - gap
This command sets the number of timer ticks (1 second = 18 ticks) of silence between individual tones. The number of timer ticks between tones is specified as a number immediately followed by G. The initial value is 0.
• D or d - duration
This command sets the length (in timer ticks) of each tone. For example, to make each tone last about a third of a second, use the command 6d.
• T or t - tempo
This command scales the duration of each tone. This allows you to change the duration of a series of tones globally, without having to change each of the individual duration commands.A tempo value of 256 indicates normal tempo. A value of 4df lasts:
• 2 timer ticks, when the tempo is set to 128
• 4 timer ticks, when the tempo is set to 256
• 8 timer ticks, when the tempo is set to 512

还可以播放WAV文件:
play2.kix
play file "C:\WINDOWS\Media\Windows XP Shutdown.wav"

[ Last edited by uiopuiop on 2008-9-25 at 06:08 PM ]

附件
007.music.zip (148.11 KiB)
第4楼 uiopuiop 发表于 2008-09-24 23:18
中级用户 发帖 211 积分 400
Originally posted by tireless at 2008-9-24 10:48 PM:
可以鸣叫,可以说话,唱歌...


请问高手是如何让批处理 “说话” 的? 哈哈,播放WAV文件不算哦。
第5楼 tireless 发表于 2008-09-24 23:21
银牌会员 发帖 1,122 积分 2,025
以下引自 http://bbs.verybat.org/viewthread.php?tid=9070&highlight=%CB%B5%BB%B0



----------------------------------------------------------------------------
可爱批处理——听听鬼佬说中文
http://bbs.verybat.org/thread-4101-1-1.html

[ Last edited by tireless on 2008-9-24 at 03:28 AM ]
第6楼 uiopuiop 发表于 2008-09-24 23:43
中级用户 发帖 211 积分 400
强! 无语。。。。

学无止境。

不知道有没有让批处理鸣叫 (不用第三方工具)的方法?

[ Last edited by uiopuiop on 2008-9-24 at 11:44 PM ]
第7楼 zqz0012005 发表于 2008-09-25 00:45
中级用户 发帖 135 积分 297
echo 
那个黑点是在cmd中按Ctrl+G生成的
第8楼 uiopuiop 发表于 2008-09-25 11:34
中级用户 发帖 211 积分 400
Originally posted by zqz0012005 at 2008-9-25 12:45 AM:
echo 
那个黑点是在cmd中按Ctrl+G生成的


就一个嘟音,有没有其他的声音啊?

echo ^G>test.txt

type test.txt (鸣叫一次)

或者: 先 echo ^@type ^>nul 2^>^&1 >test.bat


test.bat 内容为:
type >nul 2>&1

或者:echo echo >test.bat
test.bat (鸣叫两次)

或者: 想什么时候叫就什么时候叫

set beep=
echo %beep% %beep% %beep%

[ Last edited by uiopuiop on 2008-9-25 at 02:43 PM ]
第9楼 bluewaterx 发表于 2008-09-25 15:34
初级用户 发帖 68 积分 132
你试试,包你满意

@echo off
echo set mp3=createobject("wmplayer.ocx")>ps.vbs
echo mp3.url="%windir%\Help\Tours\WindowsMediaPlayer\Audio\Wav\wmpaud5.wav">>ps.vbs
echo wscript.sleep 1000>>ps.vbs
echo wscript.sleep mp3.currentmedia.duration*1000>>ps.vbs
echo wscript.quit(1)>>ps.vbs
start ps.vbs
第10楼 uiopuiop 发表于 2008-09-25 18:14
中级用户 发帖 211 积分 400
不错,看看我3楼附件里的作品。如果再跳点动画就更COOL了。
第11楼 bluewaterx 发表于 2008-09-25 18:25
初级用户 发帖 68 积分 132
Originally posted by uiopuiop at 2008-9-25 06:14 PM:
不错,看看我3楼附件里的作品。如果再跳点动画就更COOL了。



我机箱里的腊巴线我没插,开机时的嘀嘀声半夜听起来太吵了坏了-.=
第12楼 zqz0012005 发表于 2008-09-25 18:46
中级用户 发帖 135 积分 297
要说正宗中文,见此贴:利用TTS实现中英文混读
http://bbs.verybat.org/thread-13024-1-1.html

最简单的纯vbs音乐播放器
http://bbs.verybat.org/thread-13026-1-1.html
第13楼 radem 发表于 2008-09-26 00:47
高级用户 发帖 383 积分 691
verybat不是关了吗
第14楼 tireless 发表于 2008-10-01 15:57
银牌会员 发帖 1,122 积分 2,025
3 个鸣叫的 .com 文件
CHIME.COM 一段旋律
http://upload.cn-dos.net/img/805.rar

RING.COM 铃声
http://upload.cn-dos.net/img/806.rar

SIREN.COM 警报声
http://upload.cn-dos.net/img/807.rar

以上三个文件的参数:
n 鸣叫次数 (默认为 1)
/c 直到用户按键才停止鸣叫
第15楼 kaikai163 发表于 2008-10-03 13:07
初级用户 发帖 60 积分 107
太强大了!
1 2  下一页
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023