From: Walter L. (ETM) <Wal...@et...> - 2001-01-17 15:34:57
|
Hi Bruce, Thanks for your response. I looked in the /bin/mh (play sub) and with the info you gave me i think it works like this (correct me when im wrong) <In 2.39, a timer is set and it will be re-tried 1 second later, up to 5 times.> I think MH2.34 works already like you told but retrys only 2 times. I included the relevant part of /bin/mh which handle the play command. "last" checks exit status from the "play" command. If play is still busy it waits for 1 second and retrys 1 time more before it gives up. But what will happen when the wav file is long for example 6sec. For sure the 2e to play wav file will be scipped. Is it usefull to increase the counter from 3 to 10 for example when using long wavfiles? my $i; while ($i++ < 3) { no strict 'subs'; # For non-win OS # Need to use the linux equivalent here if (!$OS_win) { next if $file =~ /^System/; last unless $config_parms{sound_program}; if ($config_parms{sound_program} =~ /vv_tts/i) { # use vv_tts for play also speak(play=>"$file", nolog=>1); last; } print "running: play $file\n"; system("$config_parms{sound_program} $file &"); last if 0 == $?; } else { last if 1 == Win32::Sound::Play($file, $play_parm | SND_NOSTOP); } print "Waiting to play sound file, pass $i, file=$file\n"; sleep 1; } Thanks, Walter -----Original Message----- From: Bruce Winter [mailto:br...@mi...] Sent: woensdag 17 januari 2001 15:16 To: mis...@li... Subject: RE: [misterhouse-users] MH Play command problems > I ve a small question concerning the play command in MH. > I like to use the internal play command to play wav files etc. > This is working only when using it 1 time in a loop. > For example using this code will actually play only hello.wav but > not folks.wav. > > if ($state = said $test_voice2) { > play (rooms => $state, file => "/root/prompts/hello.wav"); > play (rooms => $state, file => "/root/prompts/folks.wav"); > } > > Debugging log shows both files are played after each other but > actually only 1 is played. > > In MH.ini i added the following attribute which says that MH have > to wait for the last playing wav file has finished. > play_mode=wait Looks like the mh.ini play_mode parm is currently only used Windows. On unix, the behaviour would depend on what the program pointed to by mh.ini sound_program wants to do (by default, this is set to the 'play' program). Prior to mh 2.39, if the sound_program had a bad rc (e.g. is still in use by previous call), mh would pause and loop for a bit, waiting for the sound card to free up. In 2.39, a timer is set and it will be re-tried 1 second later, up to 5 times. Maybe that will work better for you? Bruce ________________________________________________________ To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 |