diff options
Diffstat (limited to 'dgedit/player.cc')
-rw-r--r-- | dgedit/player.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dgedit/player.cc b/dgedit/player.cc index 782020b..b916920 100644 --- a/dgedit/player.cc +++ b/dgedit/player.cc @@ -40,16 +40,6 @@ Player::Player() pcm_data = NULL; pcm_size = 0; - ao_initialize(); - - ao_sample_format sf; - sf.bits = 16; - sf.rate = 44100; - sf.channels = 1; - sf.byte_format = AO_FMT_NATIVE; - - dev = ao_open_live(ao_default_driver_id(), &sf, 0); - connect(&report_timer, SIGNAL(timeout()), this, SLOT(reportTimeout())); report_timer.start(50); // Update 25 times per second } @@ -62,6 +52,16 @@ Player::~Player() void Player::run() { + ao_initialize(); + + ao_sample_format sf; + sf.bits = 16; + sf.rate = 44100; + sf.channels = 1; + sf.byte_format = AO_FMT_NATIVE; + + dev = ao_open_live(ao_default_driver_id(), &sf, 0); + short s[BUFSZ]; while(true) { if(playing) { |