多语种视频音频播放器的设计与实现(代码)
无需注册登录,支付后按照提示操作即可获取该资料.
摘 要
随着计算机的广泛运用,Internet的迅速发展,各种音频视频资源也在网上广为流传,这些资源看似平常,但已经渐渐成为人们生活中必不可少的一部分了。于是各种播放器也紧跟着发展起来,但是很多播放器一味追求外观花哨,功能庞大,对用户的电脑造成了很多资源浪费,比如CPU,内存等的占用率过高,在用户需要多任务操作时,受到了不小的影响,带来了许多不便,而对于大多数普通用户,许多功能用不上,形同虚设。针对以上各种弊端,选择了开发多语种的音频视频播放器,将各种性能优化,继承播放器的常用功能,满足一般用户(如听歌,看电影)的需求,除了能播放常见格式的语音视频文件,还能播放RM,RMVB格式的视频文件。此外,还能支持中文、日文、英文等语言界面。
首先研究了各种市场上流行的播放器,如MEDIA PLAYER,REAL ONE等,了解它们各自的插件及编码方式,还有各种播放器播放的特别格式文件,分析各种编码的优缺点以及各种播放器本身存在的缺陷和特点。其次,选择了Windows自带的 Windows Media Player和PPstream的PowerPlayer.dll两种比较优秀的插件进行开发,编写出功能实用,使用方便快捷的播放器。目前已经实现的功能有能播放常见视频音频文件的功能,如MP3,AVI,WMV,RM,RMVB等,拥有播放菜单,能选择节目,具备一般播放器的功能,如快进,快退,音量调节等。播放模式也比较完善,有单曲,顺序,循环,随机播放等模式。此外,界面能支持中文,日文,英文三种语言。
关键词:计算机应用技术;音频视频;播放器;插件
Design and Implementation of Multilingual Multimedia Player
Abstract
Along with computer widespread application and Internet rapid development, many kinds of audio and video resources also widely spread on-line. These resources look very ordinary, but gradually became an essential part of people’s daily life. Thereafter,verious players were developed. But many designers pursue only the fashionable appearance and versatile functions on players’ design. Hence resources’ waste was caused. For example, CPU and Memory are excessively taken. When users need the multi-task operation, it will bring much more trouble. But regarding the majority average users, many functions are not necessary. Against the shortcomings, a multilingual audio and video player is developed which remain the commonly used functions and optimize the performance. Common users can be satisfied for listening music and watching film. Except for the common form of vocal video files, the RM and RMVB form video files can be played on the player. In addition, these documents can be played in Chinese, Japanese and English.
This graduation project primary mission: Firstly, various popular players are studied such as MEDIAPLAYER, REAL ONE and so on including their embedded modules, encoding methods and data format. Advantages and disadvantages among these players are analyzed. Then two kinds of excellent active components are chosen to develop so that a practical player, which is easy to operate, is implemented. At present, the expect functions have realized such as MP3,WMV,AVI,RM and RMVB documents playing and so on. One can choose the program to play according to the menu. The player has the familiar functions such as fast forward, fast backward, volume control and so on. It has various playing modes such as single, order, circulation, and random mode. In addition, it can be played in Chinese, Japanese and English.
Key words: Computer Application Technology;Audio and Video;Player;Plug-in
设计思路:为了播放多种格式的语音视频播放器,选择了两种播放插件,一个是Windows自带的 Windows Media Player播放控件,另一个是PPstream的PowerPlayer.dll播放控件。Windows Media Player播放控件主要用于播放常见格式的视频音频文件,如AVI,MPEG,WMV等,而后者则播放RM,RMVB格式的视频文件。因为Windows Media Player不支持RM,RMVB格式的视频文件播放,想要播放RM,RMVB格式文件,必须有能支持RM,RMVB解码的播放控件。PPstream的PowerPlayer.dll播放控件封装了RM,RMVB编码的插件,因此可以满足要求。
而在程序设计时,应该将各种音频视频文件进行分类,普通音频视频格式文件用Windows Media Player控件播放,其他特殊的格式,如RM,RMVB用PPstream控件播放。而区分这些文件格式的方法也很简单,只需要在打开文件时获取文件的扩展名,如MP3,WMA,AVI等。再在程序中对扩展名进行逻辑判断,如果是常见格式的扩展名,则将多媒体文件用Windows Media Player控件播放,其他情况就用PPstream控件播放。此外,播放器在播放完一个文件时,应判断是该停止,还是继续播放,因此又形成了一个循环的关系。而这个循环关系也不是一个简单的循环,并不是单纯的播放下一个多媒体文件。还应根据当前的播放模式有所不同。如单曲循环播放模式的下一个播放文件还是当前文件,普通模式则是播放下一个文件,但是当文件指针指到了最后一个文件时,就应该停止播放,而全部循环模式则应播放列表中的第一个文件。最后是随机模式,它播放的下一个文件是随机的,也就是不可推测的。如果满足停止条件,则程序正常终止。
目 录
1 引言 1
1.1 课题背景 1
1.2 国内外知名播放软件介绍 1
1.3 课题的研究方法 2
2 调查分析 3
2.1 需求分析 3
2.1.1 功能需求 3
2.1.2 客户需求 3
2.2 可行性研究 3
2.3 各类音频视频文件的分析 3
3 环境搭建 7
4 程序设计 8
4.1 基本设计 8
4.2 程序流程图 9
4.3 代码实现过程 10
4.3.1 播放控件的接口属性 10
4.3.2 播放器外观界面设计 12
4.3.3 添加曲目的实现 12
4.3.4 媒体文件的筛选 13
4.3.5 媒体文件类型的获取 13
4.3.6 实现多种播放模式 14
5 测试 15
5.1 测试前的分析 15
5.2 音频文件播放测试 15
5.3 视频文件测试 17
5.4 多语种界面测试 20
5.5 资源占用测试 21
5.6 测试结果的总结 22
结 论 23
参考文献 23
致 谢 24
声 明 25