1、MTK 铃声修改1.1 铃声简介MTK 支持的铃声还是比较多的,常见的 MP3,WAV, MID 等等都支持。同时 MTK 既支持数组存储的铃声,也支持资源类型的铃声。不过习惯上我们一般都使用数组类型的铃声。所谓数组类型的铃声,就是把铃声数据按字节顺序存储在数组中,标明铃声的类型和长度,供播放函数使用。1.2 铃声的格式(Audio_Converter.cpp)#define FORMAT_IMY “18“ /* sync with med_main.h */#define FORMAT_MID “17“ /* sync with med_main.h */#define FORMAT_WAV
2、 “13“ /* sync with med_main.h */#define FORMAT_MMF “20“ /* sync with med_main.h */#define FORMAT_MP3 “5“ /* sync with med_main.h */#define FORMAT_PCM “7“ /* sync with med_main.h */#define FORMAT_DVI “11“ /* sync with med_main.h */#define FORMAT_AMR “3“ /* sync with med_main.h */#define FORMAT_AAC “6
3、“ /* sync with med_main.h */#define FORMAT_WMA “24“ /* sync with med_main.h */#define FORMAT_M4A “25“ /* sync with med_main.h */1.3 铃声示例(resource_audio.c)来电铃声:const audio_resource_struct mtk_resource_imelodys=s1imy01_imy, sizeof(s1imy01_imy), 18,s1imy02_imy, sizeof(s1imy02_imy), 18,s1imy03_imy, size
4、of(s1imy03_imy), 18,s1imy04_imy, sizeof(s1imy04_imy), 18,s1imy05_imy, sizeof(s1imy05_imy), 18,s1imy06_imy, sizeof(s1imy06_imy), 18,s1imy07_imy, sizeof(s1imy07_imy), 18,s1imy08_imy, sizeof(s1imy08_imy), 18,s1imy09_imy, sizeof(s1imy09_imy), 18,s1imy10_imy, sizeof(s1imy10_imy), 18,;注:18 对应的是音乐格式开关机音调:c
5、onst audio_resource_struct mtk_resource_sounds=cs_iphonemessage1_mp3, sizeof(cs_iphonemessage1_mp3), 5,cs_iphonemessage2_mp3, sizeof(cs_iphonemessage2_mp3), 5,cs_iphonemessage3_mp3, sizeof(cs_iphonemessage3_mp3), 5,cs_iphonemessage4_mp3, sizeof(cs_iphonemessage4_mp3), 5,cs_iphonelock_mp3, sizeof(cs_
6、iphonelock_mp3), 5,cs01_shutter, sizeof(cs01_shutter), 5,cs01_usb_beep_mp3, sizeof(cs01_usb_beep_mp3), 5,; 注:5 对应的是音乐格式短信音调:const audio_resource_struct mtk_resource_message_sounds=cs_iphonemessage1_mp3, sizeof(cs_iphonemessage1_mp3), 5,cs_iphonemessage2_mp3, sizeof(cs_iphonemessage2_mp3), 5,cs_iphon
7、emessage3_mp3, sizeof(cs_iphonemessage3_mp3), 5,cs_iphonemessage4_mp3, sizeof(cs_iphonemessage4_mp3), 5,cs_iphonemessage5_mp3, sizeof(cs_iphonemessage5_mp3), 5,cs_iphonemessage6_mp3, sizeof(cs_iphonemessage6_mp3), 5,; 注:5 对应的是音乐格式Custpack_audio.c来电和弦铃声:const custpack_audio_header custpack_audio = 6,
8、iphone_marimba_mp3, sizeof(iphone_marimba_mp3), 5,iphone_duck_mp3, sizeof(iphone_duck_mp3), 5, iphone_crickets_mp3, sizeof(iphone_crickets_mp3), 5,iphone_harp_mp3, sizeof(iphone_harp_mp3), 5,iphone_motorcycle_mp3, sizeof(iphone_motorcycle_mp3), 5,iphone_xylophone_mp3, sizeof(iphone_xylophone_mp3), 5;注:6 对应的是和弦个数,5 对应的是音乐格式客户自定义按键音需打开宏:CUST_KEYPAD_TONE_SUPPORTmtk_resource_keypad_tones1.4 铃声使用像添加图片一样,在 Customer 里创一个文件夹,放入铃声,然后像添加图片一样添加一个 ID,并在模块对应的 RES 文件里绑定把 ID 和路径绑定。可以使用 mdi_audio_play_id 播放,或者使用 get_audio 获得数据,然后调用 mdi_audio_snd_play_string_with_vol_path 播放