Re: Enhanced PLAY.CMD with play list support

From: Michael Baldwin Bruce (mbbruce_at_mighty.co.za)
Date: 11/03/04


Date: 3 Nov 2004 01:46:13 -0800

bruce aka tholen@antispam.ham wrote in message news:<35Lhd.56735$Kl3.52139@twister.socal.rr.com>...
> Marty writes:
>
> >>> Peter Weilbacher wrote:
>
> >>>> Michael DeBusk wrote:
>
> >>>>> Marty wrote:
>
> >>>>>> Hi folks. I've been doing some REXX hacking lately and made some
> >>>>>> modifications to the standard PLAY.CMD script that IBM ships with
> >>>>>> MMOS/2.
>
> >>>>> Looks good from here.
>
> >>>> Yes, nicely done!
>
> >>> Thanks!
>
> >>>>> If I could make a wish, I'd wish that it didn't require the "FILE="
> >>>>> parameter. For some reason, I want to invoke it as "play foo.wav".
>
> >>>> Second that. Additionally, instead of the list= parameter, how about
> >>>> calling it like "play *.wav" and it automatically expands... OK, just
> >>>> dreaming. :-)
>
> >>> I could easily make another version to do this, but my intent with this
> >>> script was to be a drop-in replacement for IBM's PLAY.CMD (with complete
> >>> backwards compatibility).
> >>>
> >>> The most important aspect of the script for me was the resource leak
> >>> fix. Something inside of Timidity_MCD does not get cleaned up correctly
> >>> without the call to mciRxExit(). Strangely, missing this call doesn't
> >>> seem to cause a problem with any other codecs that I've found, just
> >>> Timidity. I guess the other codecs are smarter about cleaning up after
> >>> sloppy processes.
>
> >> I've probably encountered that problem. There have been times when
> >> PLAY.CMD would fail, while other audio file playing utilities would
> >> continue to work, including some Windows-based ones. But I have also
> >> encountered one instance in which PLAY.CMD worked from inside my editing
> >> program but failed as a standalone utility in another windowed command
> >> prompt session. Haven't been able to figure that one out.
>
> > Did you get any messages from PLAY about a "REXX Alias" or something to
> > that effect?
>
> Unfortunately, I cannot reproduce the problem on demand, so I have to
> rely on memory for the error message, but it was something like
> "mciRxInit routine not found".
>
> > Instead of maintaining handles with binary data and the
> > like, in REXX you create a name or "alias" to associate with your MCI
> > device. Every multimedia operation you do in REXX is done against this
> > alias so that the state is maintained by the MMPM libraries, but your
> > context is maintained.
> >
> > Unfortunately, PLAY.CMD hard-codes a REXX alias name, so that if you
> > attempt to run two of them at the same time, the same alias is used and
> > the context is applied from your original running PLAY.CMD. Likewise,
> > if you fail to close out and free the REXX alias (due to killing the CMD
> > process, for example), its state continues to be maintained by the
> > system. The alias is global. You have to free up the REXX alias before
> > it can be used again.
>
> Well, that seems consistent with one occasion in which I was repeatedly
> playing a very short audio clip, pressing the key to repeat the play
> very rapidly, such that it seems possible the system started up the next
> PLAY before completely cleaning up after the previous PLAY.
>
> > My version of PLAY checks for this condition and performs the free if
> > needed.
>
> I'm not sure under what conditions my audio subsystem supports the
> simultaneous playing of two audio streams. I'm using the SoundMax
> audio built in to the Intel 850 motherboard (ADI 1885). I know that
> if I'm playing a .wav file, then fire up Mahjongg, it complains about
> the device being busy, even though I've disabled sounds in Mahjongg.

maybe its complaining becuse you added it to one of your lits to
teach it a lesson, kook.

>
> On the other hand, the driver came with WarpMix, so it looks like it
> should be able to mix at least a few audio sources.

you mean like Barnes, kook?

>
> >> And I've
> >> also seen cases where the first invocation of PLAY.CMD would return an
> >> error message but a second invocation would cause the entire windowed
> >> command prompt session to die.
>
> > This one sounds like the MM libraries ran out of resources somewhere or
> > were left in an unstable state. This can be caused by not cleaning up
> > properly. I've seen this happen on my own system but haven't been able
> > to nail down the exact spark that triggered it. Since modifying
> > PLAY.CMD, I haven't seen this happen, but I'm not convinced that the
> > problem is gone yet.
>
> >> I'm curious as to how much digging others did to try and find the
> >> kinds of TIMEFMT supported by PLAY.CMD. I know it supports "samples"
> >> and "ms" (for milliseconds), but the default units are something like
> >> 15 samples (for 44.1 kHz audio). Haven't dug enough to understand
> >> the origin of that choice. Any other time formats supported?
>
> > 15 samples / 44100 samples/sec = .00034 secs of audio
> >
> > Seems like a strange choice indeed. It is approximately 1/100th of a
> > normal process time slice (32ms). That's a bit of a stretch, though.
>
> Sufficiently odd that I never use the default (other than to
> investigate it), which means I always have to use the TIMEFMT keyword,
> which is a bit annoying. On the other hand, my editing program works
> with the audio samples in memory, so to play an edited clip using
> PLAY.CMD, I need to write it to disk, so as long as I write just the
> clip I want to hear, I don't have to bother with the FROM, TO, and
> TIMEFMT keywords. Would be nicer to simply play a clip of audio
> samples directly from memory and thus avoid hitting the disk every
> time I want to repeat a short clip, but then I'd have to learn an
> entirely new part of the multimedia system. One of the editing
> tools plays a short clip whose end points I can move in 0.01 sec
> increments using the cursor keys; it has to write a new .wav file
> every time I press the key so as to utilize PLAY.CMD.

wow! you are a kook, bruce.



Relevant Pages

  • Re: Enhanced PLAY.CMD with play list support
    ... > playing a very short audio clip, pressing the key to repeat the play ... > PLAY before completely cleaning up after the previous PLAY. ... > with the audio samples in memory, so to play an edited clip using ...
    (comp.lang.fortran)
  • Re: Baffeled with IllegalArgumentException exception
    ... is a harware problem the exception will be consistent, ... Iam using java sound API to play the audio. ... Iam using the Clip class to ...
    (comp.lang.java.help)
  • Re: No audio w/captured video
    ... but now there is no audio when i play an unedited clip ... them in the Movie Maker Collection folder. ... When I put a clip on the story ...
    (microsoft.public.windowsxp.moviemaker)
  • No Audio in timeline
    ... I play the clip in MM the audio is fine. ... It's only on the timeline the audio doesn't play. ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: Error C00D11B1 When trying to play .WMA files use Windows Medi
    ... I can play both the .wma and the .wmv samples no problem at all. ... ACM Microsoft IMA ADPCM CODEC 0011 imaadp32.acm 5.1.2600.2180 ... ACM Windows Media Audio 0161 msaud32.acm 8.0.0.4487 ...
    (microsoft.public.windowsmedia.player)