MMCC MASTHEAD




MMCC's
PL/B notes
    Notes home
    Intro
    History
    Article index


v1.10
Mid-Michigan Computer Consultants, Inc.
509 Center
Bay City, Michigan

Sales (989) 892-9242             Support (989) 686-8860


ANSI Standard PL/B Language
SOUND FILES
NOTE TO OUR READERS
This web resource is written for our own use. But we feel strongly that the PL/B language should be shared with the software community. So feel free to use this at will! BUT PLEASE... if you find errors or omissions or have a better way to do something. TELL US! Dialog helps us all. Send e-mail to: support@mmcctech.com

SOUND FILES

This is a PRELIMINARY discussion.

Just a reminder that PL/B can play WAV files.
    Sound_File  SNDFILE
                SNDOPEN   Sound_File,"MyWay.WAV"
                SNDPLAY   Sound_File
                SNDCLOSE  Sound_File

NOTES

From the Sunbelt Web board 4/5/2004 from PaulFuh of New York:
    "How about using resource ID and Media Control Interface functions? "

Answer from Ed Boedecker:
1. The MCI keyword specified in the SNDOPEN instruction simply causes the Microsoft Media Control Interface functions to be used when playing the sound wave file. This does not provide any more functionality for a user program. The user program still uses SNDOPEN, SNDPLAY, and SNDCLOSE to play a wave sound file.

2. Note (5.) in the Language Reference Manual identifies that the '@" is used with a form resource name. This note does not say resource ID. When resources are added to a form, there are two identifications for that resource. The first reference is a 'Name' that identifies a resource by a name string. This Name reference is set to a default name and can be changed by the user. The second is a 'Resource ID' which is a numeric value. The SNDOPEN is implemented to accept the '@' to identify a resource by a name string reference.

I verified that the following instruction does work as implemented to use a form resource where 'ResName' is the name of the sound resource.
    SNDOPEN SNDFILE,"@ResName"
End of Ed's answer. A response from Paul was:
Using the resource name with '@' didn't work for me the first time because the name is case sensitive. Also, if '@' is used, adding "MCI" to open will give I10 error. Microsoft media control interface will not see plform resources.



Send e-mail to MMCC.

Write to MMCC Technical Support at: MMCC, Inc.
600 W. Midland
Bay City, MI 48708
(989) 686-8860 Home

© 1997-2002 MMCC, Inc. All Rights Reserved.
Report problems or suggestions to support@mmcctech.com