#1187 No sound from play(file,'YES')

4.1.3
invalid
none
4
2013-07-16
2013-07-08
Swifty
No

ooRexx 4.1.3 64-bit
Z=play('1.wav') / Works /
Z=play('1.wav','YES') / Fails; no sound /

Sample code:

Say 'Playing 1.wav'
Z = Play('C:\$User\Tools\1.wav','YES')
Say 'Played 1.wav'
Exit
::Requires OODialog.cls

Discussion

  • Swifty

    Swifty - 2013-07-08

    The salient (and missing) fact: Without the "YES", the file plays; with the "YES" (or seemingly any non-blank argument #2) there is no sound.

     
  • Mark Miesfeld

    Mark Miesfeld - 2013-07-08
    • labels: --> ooDialog
    • assigned_to: Mark Miesfeld
     
  • Mark Miesfeld

    Mark Miesfeld - 2013-07-08

    Hi Steve,

    I don't think this is a bug.

    If we take your example, changed slightly to access a .wav file that is on my system:

    Say 'Playing nope.wav'
    soundFile = 'C:\work.ooRexx\wc\ooDialog\trunk\examples\wav\nope.wav'
    Z = Play(soundFile,'YES')
    Say 'Played nope.wav'
    Exit
    ::Requires OODialog.cls

    I see that it behaves the same under ooDialog 4.1.0 and ooDialog 3.2.0 as it does under ooDialog 4.2.2, you do not hear a sound.

    The reason is that the YES argument is used to cause the sound to play asynchronously. The sound itself is played on another system thread. In your example, you start the sound and then immediately exit. The interpreter ends, the interpreter process ends, and when the process ends, any threads started by that process are ended. The other thread is a system thread that the interpreter knows nothing about.

    A simple test of this theory would be to start the sound with the YES argument and delay the end of the interpreter process. And, sure enough if you try this example, you will indeed hear the sound:

    Say 'Playing nope.wav'
    soundFile = 'C:\work.ooRexx\wc\ooDialog\trunk\examples\wav\nope.wav'
    Z = Play(soundFile,'YES')
    z = SysSleep(2)
    Say 'Played nope.wav'
    Exit
    ::Requires OODialog.cls

    The second optional argument can be YES or LOOP. When you do not include the YES argument, or it is anything other than YES or LOOP, the sound is played synchronously. Which is why omitting the argument works. The Play() routine does not return until the sound is finished.

    When you first opened this bug, I thought you had a program that worked previously, that no longer works with ooDialog 4.2.2, which is the version of ooDialog included in ooRexx 4.1.3.

    I'm going to leave this open for a couple of days in case you do have a program that worked under ooRexx 4.1.2, but no longer works under ooRexx 4.1.3. If not, I'll close this as invalid.

    Thanks for taking the time to open this, I'm sure there are undiscovered bugs in ooDialog. So don't hesitate to open up another bug if you do find one.

     
  • Swifty

    Swifty - 2013-07-09

    Mark, I'm prepared to drop this as it's almost certain that I changed from synchronous to asynchronous whilst migrating from InstMMFuncs.cls to OODialog.cls

    That happened yesterday, and as far as I'm concerned that is already lost in the mists of time!

     
  • Mark Miesfeld

    Mark Miesfeld - 2013-07-16
    • labels: ooDialog --> ooDialog, Not a bug
    • status: open --> invalid
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks