comparison tests/swig_tests/audio_tests.py @ 0:4a0efb7baf70

* Datasets becomes the new trunk and retires after that :-)
author mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 29 Jun 2008 18:44:17 +0000
parents
children 4c8334b0ab30
comparison
equal deleted inserted replaced
-1:000000000000 0:4a0efb7baf70
1 #!/usr/bin/env python
2 from swig_test_utils import *
3 import time, fifelog
4
5 class TestAudio(unittest.TestCase):
6
7 def setUp(self):
8 self.engine = getEngine(True)
9 self.soundmanager = self.engine.getSoundManager()
10 self.log = fifelog.LogManager(self.engine, promptlog=True, filelog=False)
11 self.log.setVisibleModules('pool', 'audio')
12 self.soundmanager.init()
13
14 def tearDown(self):
15 del self.engine
16 del self.log
17
18 def testLeftRight(self):
19 sound = self.soundmanager.createEmitter()
20 id = self.engine.getSoundClipPool().addResourceFromFile('tests/data/left_right_test.ogg')
21 sound.setSoundClip(id)
22 sound.setLooping(True)
23 sound.play()
24 time.sleep(15);
25
26 def test2Streams(self):
27 em = self.soundmanager.createEmitter()
28 sound = self.soundmanager.createEmitter()
29 id = self.engine.getSoundClipPool().addResourceFromFile('tests/data/left_right_test.ogg')
30 sound.setSoundClip(id)
31 sound.setLooping(True)
32 sound.setCursor(fife.SD_TIME_POS, 5)
33 em.setSoundClip(id)
34 em.setGain(0.7)
35 em.play()
36 sound.play()
37 time.sleep(15);
38
39 TEST_CLASSES = [TestAudio]
40
41 if __name__ == '__main__':
42 unittest.main()