paul.w Posted May 21, 2014 Posted May 21, 2014 Hi The sounds is not playing, why ? What wrong with the following code? init() { setUpScreen(); } void setUpScreen() { gameRunVideoBground = new WidgetSpriteVideo(gui, engine.getDataPath() + "videos/gamebackground/" + gamebackgroundVids[videoNumberGameBg]);gameRunVideoBground.addLayer(); gameRunVideoBground.setOrder(1);gui.addChild(gameRunVideoBground,GUI_ALIGN_EXPAND);gameRunSoundBground = new AmbientSource(engine.getDataPath() + "videos/gamebackground/" + gamebackgroundVids[videoNumberGameBg]);gameRunVideoBground.setAmbientSource(gameRunSoundBground); } then in update update() { if(gameRunVideoBground != NULL && gameRunVideoBground.isPlaying() == 0 && state == 3 && state3Played == 1) { gameRunVideoBground.setVideoTime(0.01f); gameRunSoundBground.setLoop(1); gameRunSoundBground.play(); gameRunVideoBground.play(); }
silent Posted May 22, 2014 Posted May 22, 2014 Hi Paul, Sorry, can't reproduce. Please, check the <SDK>/data/samples/widgets/video_01 sample. Video and audio should play correctly here. Also, in attached zip archive you can find simple test scene with playing video and audio. You will need to put the files in <SDK>/data directory and modify path to the video file inside script. I've tested it on your mov1.ogv file and it worked just fine. Thanks! audio_test.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
paul.w Posted May 22, 2014 Author Posted May 22, 2014 The audio_test.zip does not work on my computer sounds does not play :(
silent Posted May 22, 2014 Posted May 22, 2014 Hi Paul, Sorry, my bad :) You need to have a player in the world to hear sound sources. So, you need to add in init(): PlayerDummy player = new PlayerDummy(); engine.game.setPlayer(player); How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts