當前位置:首頁 » 編程語言 » c語言加音樂

c語言加音樂

發布時間: 2022-12-25 14:53:40

1. 如何在c語言程序中添加背景音樂

用PlaySound 函數可以播放 .wav 格式音樂。x0dx0a例如 下面 播放 紫竹調.wav 格式音樂,它存放在 D:\\zzz\\zzd.wav x0dx0a其它音樂格式能不能播放,要試驗一下才知道,也許不行,也許可以。x0dx0a#include x0dx0a#include x0dx0a#include x0dx0a#pragma comment(lib, "winmm.lib")x0dx0ax0dx0avoid main(){x0dx0aPlaySound (TEXT("D:\\zzz\\zzd.wav"), NULL, SND_ASYNC | SND_NODEFAULT);x0dx0a x0dx0awhile (1) x0dx0a{x0dx0a printf("program is running... here\n"); //這里跑你的程序,按 Ctrl-C 組合鍵,結束程序。x0dx0a Sleep(1000); //休息1秒x0dx0a}x0dx0ax0dx0aexit(0);x0dx0a}

熱點內容
安卓為什麼跳水 發布:2025-07-05 09:55:08 瀏覽:87
達內學校php 發布:2025-07-05 09:52:05 瀏覽:398
獲取資料庫所有表 發布:2025-07-05 09:39:12 瀏覽:654
wcfphp 發布:2025-07-05 09:39:07 瀏覽:178
解壓密碼對 發布:2025-07-05 09:33:00 瀏覽:586
廣東金稅盤的伺服器地址是什麼 發布:2025-07-05 09:10:29 瀏覽:704
掛式手機卡的服務密碼是多少 發布:2025-07-05 08:57:40 瀏覽:944
電信卡密碼八位數是多少 發布:2025-07-05 08:49:37 瀏覽:441
配置高用的久選什麼電腦 發布:2025-07-05 08:22:40 瀏覽:741
迷你世界如何卡進設密碼的房間 發布:2025-07-05 08:15:16 瀏覽:882