游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2256|回复: 0

??????1.4??Demo?3:????

[复制链接]

50

主题

69

帖子

69

积分

注册会员

Rank: 2

积分
69
发表于 2010-5-24 17:55:00 | 显示全部楼层 |阅读模式
??????1.4??Demo?3:????


???????????????????????,???????????????

/*!==========================================================================
*
*  ??????(GaiMo Game Engine)
*
*  ???? (C) 2009-2009 ??????????? ??????
*  Copyright (C) ???????????.  All Rights Reserved.
*
*  ??????,??? http://www.gaimo.net
****************************************************************************/
#include <AudioDevice.hpp>
#include <conio.h>
#include <cmath>
#include <iostream>
/*!==========================================================================
*
*  ??????(GaiMo Game Engine)
*
*  ???? (C) 2009-2009 ??????????? ??????
*  Copyright (C) ???????????.  All Rights Reserved.
*
*  ??????,??? http://www.gaimo.net
****************************************************************************/
#include <iostream>
#include <conio.h>
#include <AudioDevice.hpp>

char* mp3 = "..\\audio//DarinPeerless.mp3";
char* ogg = "..\\audio//GetOut.ogg";
short flag = 0;

int main()
{   
    std::cout<<"??????????!"<<std::endl;
        //! ??????????????
        core::AudioDevice *device = core::InitAudioDevice();
   
        std::cout<<"??mp3??ogg(0 for MP3?1 for ogg)"<<std::endl;
        std::cin >> flag;
        std::cout << std::endl;
   
    //! ??????
    core::RefPtr<core::AudioSource> source = device->GetAudioSource();
   
    //! ????????
        if(flag == 0)
        std::cout<<"play:"<<source-&gtlay(mp3,true)<<std::endl;  
        else
        std::cout<<"play:"<<source->Play(ogg,true)<<std::endl;
        while(getche() != 'q');
       
        core::TerminateAudioDevice();
    system("pause");
     
    return EXIT_SUCCESS;
}

??:??????????????????API??
??????,???????
?????ccsdu2004@yahoo.com.cn
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-10-15 01:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表