Copyright: WavePlayer Copyright® 1994  Lighthouse Engineering


Contents

 Overview

 Licensing Agreement

 Registering WavePlayer

 WavePlayer Class Reference

 Getting Help

 Index

 Glossary


Overview
WavePlayer Class Overview

Description of WavePlayer

This is a shareware evaluation version of the WavePlayer class library. As such, this represents a subset of the full capabilities of the class library. Further, since source code is not provided, you are not able to benefit from the possibility of enhancing and customizing the WavePlayer classes. As a rule, it is my sincere preference to distribute my shareware products in their pure, unadulterated, form. However, when it comes to programming tools and add-ons, there seems to be a need to do otherwise. I regret that this demo does not include the full capability of the class library. However, I trust that it is functional enough to be of benefit to those who choose to use it without registering (now we know no-one fails to register their shareware! Right?). I also trust that you will find the capabilities this product can add to your application to be significant enough to warrant registering it. At any rate, here it is and I hope you are impressed with both the capabilities and the documentation provided with the demo.

The WavePlayer class offers plug and play support for MultiMedia sound in your Borland C++ 4.0 applications. Optional support of OWL 2 is also provided in the source. The class accepts wave data both in file form and as program resources. Further, multiple files or resources can be strung together to build sentences or sound sequences to be executed in a single step. The WavePlayer classes make use of buffered pre-fetch to load as many of the files or resources into memory as possible before playing; in this way sound sequences are executed quickly with minimal pause between sounds. Using the WavePlayer classes makes adding sound capability to your applications a painless, no brains required, operation. It just doesn't get any easier.

The WavePlayer class is written entirely in C++ using the Borland C++ 4.0 IDE, etc. and is fully compatible with Microsoft Windows 3.1 - I have not had the opportunity to test it on other platforms, however, it should port with ease if it does not compile and run out of the box. I have no experience with MFC and, therefor, can not say how easily it will port. However, once again, I should think that a minor task as very minimal use of OWL is made and is, in fact, optional. Resource management, loading, locking and playing are accomplished through the WIN16/API library functions provided with Borland C++ 4.0. To the best of my knowledge, these API calls are all supported in the WIN32/API libraries, as well. Sounds are generated via the sndPlaySound() API call.

Additional Features of The Registered Version

As previously stated, the shareware evaluation version of WavePlayer is a subset of the entire class library. In addition to the features provided here, there are several other features. Further, some of the features here operate in a slightly different manner than in the registered version. While the programmer's interface to the library is constant, some of the capabilities are enhanced in the registered version and where applicable these restrictions are noted in the reference material included in this help file

The first thing to mention is that the buffered pre-fetch option can be enabled and disabled, on-the-fly, in the registered version. In this way the program can dynamically manage it's use of the system resources available to it. If resources are tight and you want to play asyncronous sounds without expending the available resources, disable pre-fetch, call Execute() and continue on your way. You can later re-enable pre-fetch to play a syncronous sequence of sounds.

The registered version of the library supports three levels of sequencing for your sounds. First, syncronous, plays each sound and waits for it to be completed before continuing to the next. Control is not returned to Windows or to your application until the last sound has been played. Second, asyncronous, plays the sounds without waiting for them to be completed which, in turn, permits your application to continue working while the sounds are played. This method supports call back from the sound system to feed the next sound and performs self-cleanup when the class is destructed. Third, psuedo syncronous, plays sounds and permits Windows to continue handling messages but does not return to your application until all sounds have been played. This shareware evaluation version of the library only supports syncronous and psuedo syncronous playing of sounds.

Among other features disabled in the demo version is prefetching of files. In the registered version, the WavePlayer class locates and loads files into memory in the same manner it currently does for resources. This permits better performance on machines with slow drives, as well as, reusing wave data in sound loops.

Sound loops are an additional feature of the registered version which permit the sound system to loop through a series of sounds as opposed to a looping a single sound as provided by the Windows API. In asyncronous mode the sound loop will continue to play until you interrupt it via a call to WavePlayer::KillSound() which is not provided in the demo version. In syncronous and pseudo-syncronous modes, you specify the number of times to perform the loop.

The registered version adds support for compressed file and resource formats, as well. This is accomplished via an ExecutePacked() set of methods which duplicate the functonality of the Execute() methods you will find in this demo. These methods load the resource or file into memory then call a virtual method, unPack(), to expand the data in memory prior to passing the data on to the sndPlaySound() function. The base WavePlayer class includes a do-nothing definition of the method which simply passes back the pointer for the data. However, you can easily derive a class from the base class and replace this method with one of your own. In this way you can choose the data compression you prefer and implement it with both sound resources and sound files through one user defined method. The programmer can specify whether packed sound data should be expanded on the fly (just before passing to sndPlaySound() ) or if all data should be expanded before passing the first one in the list to the player. Packed wave data is differentiated in your resource files by the resource type wpPACKEDWAVE.

Aside from the features mentioned here, I am constantly working to enhance the class and improve it's performance. Among the things to be worked out is support, either directly or through a derived class, for MCI functions.


Licensing Agreement

WavePlayer is distributed via the shareware distribution method. Users are granted a license to use this software for evaluation purposes only for a period not to exceed thirty days. After this period, users must either register thier copy of WavePlayer (purchase a license for continued use and other benefits) or cease using the software and delete all copies from their system. More information can be found in the Registration section of this file.

SHAREWARE LICENSE AGREEMENT

This is an agreement between you (either an individual or an entity) and Lighthouse Engineering. By using or distributing copies of the shareware evaluation version of the WavePlayer package in any way, you are agreeing to be bound by the terms of this agreement. If you do not agree to the terms of this agreement, you must cease using or distributing this software immediately.

1 	COPYRIGHT: WavePlayer is Copyright© 1994 by Lighthouse Engineering and is protected by United States copyright laws and international treaty provisions. Except to the extent expressly licensed, the copyright holder has and reserves the exclusive copyright and other right, title, and interest to copy and distribute this software, and the right to use the trademark WavePlayer in connection with it.

2 	LICENSE TO USE: You may use this shareware evaluation version of WavePlayer for a period not to exceed thirty (30) days. If you wish to use it beyond this period, you must register by making the necessary payment to Lighthouse Engineering as outlined elsewhere in this package.

3 	DISTRIBUTION FEES: Regardless of any fees you may have paid to obtain this shareware evaluation version of WavePlayer, whether via BBS, tradeshow, publication, swap meet, shareware distributor, bundled software, publication, or any other form of distribution channels, you do not own a license to this package except as expressly stated here-in. Such fees are for recuperation of the distribution expense incurred by the distributor and have no bearing, what-so-ever, on your license to use this package. Regardless of any fees paid, you are not released from your responsibility to register this package for its continued use beyond the thirty (30) day evaluation period except and unless expressly stated otherwise here-in.

4 	NON-COMMERCIAL DISTRIBUTION: You are granted a license to copy and distribute the shareware evaluation version of WavePlayer in a non-commercial manner. Distribution is non-commercial if it is for free, or by any not-for-profit organization or by hobby, user or computer interest group to its members, or by any BBS, provided the WavePlayer package is not modified or abridged in any way. Lighthouse Engineering reserves the right to revoke this license at any time for any reason on 90 days advance written notice. Commercial distributors should contact Lighthouse Engineering directly for distribution information.

5 	DISTRIBUTION OF BINARIES: Any distribution, whether public or private, free or for compensation by any group, entity or individual of any portion of the shareware evaluation version of WavePlayer as part of another product including, but not limited to, applications, programs, libraries, objects, derived classes or enhancements is strictly and expressely prohibited except as stated in paragraph four (4) of this agreement. This paragraph shall become null and void upon receipt of payment to Lighthouse Engineering for the registered version of WavePlayer upon which time the distribution terms of the Licensing Agreement you purchase for the registered version of WavePlayer shall become in force in its place.

6 	THIS PACKAGE (CONSISTING OF THE WAVEPLAYER SOFTWARE AND ASSOCIATED FILES AND DOCUMENTATION) IS PROVIDED "AS IS" WITHOUT REPRESENTATION OR WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY REPRESENTATIONS OR ENDORSEMENTS REGARDING THE USE OF, THE RESULTS OF, OR PERFORMANCE OF; ITS APPROPRIATENESS, ACCURACY, RELIABILITY, OR CURRENTNESS. THE ENTIRE RISK AS TO THE USE OF THIS PACKAGE IS ASSUMED BY THE USER. IN NO EVENT WILL LIGHTHOUSE ENGINEERING OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES, DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL, RESULTING FROM ANY DEFECT IN THE PACKAGE OR AS A RESULT OF YOUR USE OF THIS PACKAGE, EVEN IF LIGHTHOUSE ENGINEERING OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ANY AND ALL USE OF THIS PACKAGE, FOR ANY PURPOSE, WITH NO REGARD TO THE LEGALITY OF SUCH USE OR PURPOSE, IS THE COMPLETE AND SOLE RESPONSIBILITY OF THE USER. Some states do not allow disclaimers of implied warranties or the exclusion of consequential damages, so the above disclaimers and exclusions may not apply to you.

7 	REVOCATION OF LICENSE: Your license to use or distribute the shareware evaluation version of WavePlayer shall be considered null and void immediately and without further notice should you violate any term of this license. Any and all intellectual property, generated by or through the use of the shareware evaluation version of WavePlayer shall become the sole property of Lighthouse Engineering. Upon any such revocation of license, Lighthouse Engineering claims all rights to the shareware evaluation version of WavePlayer and all intellectual property associated with same without exception.

8 	GOVERNING LAW: This agreement is governed by the laws of the Commonwealth of Virginia. Should any part or parts of this agreement be deemed unlawful they shall be stricken in part, the remainder of this agreement shall continue to apply in full force.

NOTE: The registration version of this package sent to registered users includes a software license agreement. This agreement is similar to the "shrink wrap" agreements found in most software packages distributed through retail channels. Registered users will have the option of returning the package for a full refund if they do not agree to the terms of that agreement. There are no royalties, fees or limitations set upon your distribution of applications you develop using the WavePlayer classes. Distribution of the WavePlayer libraries, object files and source is restricted. For a general discussion of the terms of the register user license, see the Registration section elsewhere in this package.

Copyright© 1994 Lighthouse Engineering - All rights reserved.
WavePlayer is a trademark of Lighthouse Engineering
All other trademarks mentioned are the property of their respective companies.

ALL TERMS ARE SUBJECT TO CHANGE WITHOUT NOTICE


Registering WavePlayer

About Shareware

The shareware distribution method is an innovative way to market - and obtain! - exciting new software products like WavePlayer. Users, such as yourself are given the opportunity to try software for free or a nominal distribution charge before you make the descision to buy the product. In the event you try a product and are not impressed, you have only to delete it from your system and forget it... you have lost nothing in the exchange. Independant software companines like Lighthouse Engineering are offered the freedom to publish their software titles with minimal overhead. Low overhead, in turn, helps keep prices down and spurs a brand of creativity and dedication found only in the shareware market.

Shareware distribution depends on the support of those who use shareware products. Please feel free to give copies of the shareware evalaulation version of WavePlayer to your friends and colleagues. And, remember, if you use WavePlayer beyond the evaluation period, it is your responsibility to register.

Registration Options

WavePlayer is licensed in three ways. First, the Redistribution License which gives you the right to develop and distribute applications that make use of WavePlayer classes and methods. This license does not provide you with source code, you receive the libraries and headers only. The second license option is the Source Code License which gives you the right to retain a copy of the source code and to make whatever modifications and alterations you might like to that source. This license is separate from the Redistribution License and does not give you the right to distribute applications that employ WavePlayer classes or methods. This license is for your own personal use of WavePlayer only. The last license is the Developer's License which provides both source code and binaries along with the ability to redistribute the applications, add-ons or derived classes you develop without royalty.

1 	Redistribution License Only ($15 per copy)

With this license you can develop programs that use WavePlayer classes and methods and redistribute them either for free or for compensation as you please. However, you may not distribute the libraries or headers themselves. Further, without the source you will be unable to modify or customize the WavePlayer classes, methods and use of resources.

2 	Source License Only ($25 per copy)

With this license you can develop programs for your own use and customize WavePlayer as you like. You may not, however, distribute the programs you develop using WavePlayer classes and methods or distribute the source code (in original or modified form) whether for free or for compensation..

3 	Developer'st License ($35 per copy) => Source & Redistribution

With this license you can both customize WavePlayer as you see fit and distribute the programs you develop using the WavePlayer classes, methods and resources. Further, you can distribute add-ons and customizations to the source and/or libraries so long as the recipient either has or obtains a corresponding license with Lighthouse Engineering. It is, under these circumstances, your responsibility to ensure that the user does have the correct license.

All WavePlayer licenses are one user, one copy, one machine licenses. This limitation applies to the source code, object files, libraries and include files and does not apply to the applications you distribute provided you have at least one redistribution license. Therefor, if you are using WavePlayer in a team project, each workbench must maintain it's own license.

Educational discounts and Site License Available

Why register?

Users are granted a license to use this shareware evaluation version of WavePlayer for a thirty (30) day evaluation period without cost. After this period, you must either register the package or remove it from your system. We certainly hope you will find WavePlayer useful and register it.

•	First and most important... Shareware, as a concept, depends upon the honor system among those who evaluate the programs. If users do not register the shareware they use, the authors earn nothing for their efforts and will, eventually, give up the idea of shareware distribution. You, as a computer user, will lose a valuable source of affordable software. If you like the shareware applications you use, their authors deserve their due.

As a Redistribution License registered user, you will receive...

•	A license for continued use of WavePlayer

•	A License permitting royalty free distribution of your applications of WavePlayer - whether programs, add-ons or derived classes providing that add-ons or derived classes do not include the WavePlayer objects, libraries or include files themselves.

•	A printed manual

•	A disk containing the libraries and include files for the latest version of the full implementation of WavePlayer

•	Unlimited free support via telephone or CompuServe

•	Free updates to any and all future version 1.XX releases. (A minimal disk and shipping charge may apply)

•	Substantial discounts on any major version releases of WavePlayer or on other Lighthouse Engineering software releases.

As a Source Code License Registered use, you will receive...

•	A license for continued use of WavePlayer

•	Complete source code for all WavePlayer classes and methods along with the libraries and include files for the latest full implementation of WavePlayer.

•	A printed manual

•	The ability to customize and modify the WavePlayer classes and methods for your own personal use.

•	Unlimited free support via telephone or CompuServe

•	Notices of bugs and fixes as they arise

•	Free updates to any and all future version 1.XX releases. (A minimal disk and shipping charge may apply)

•	Substantial discounts on any major version releases of WavePlayer or on other Lighthouse Engineering software releases.

As a Developer's License Registered use, you will receive...

•	A license for continued use of WavePlayer

•	Complete source code for all WavePlayer classes and methods along with the libraries and include files for the latest full implementation of WavePlayer.

•	A printed manual

•	A License permitting royalty free distribution of your applications of WavePlayer - whether programs, add-ons or derived classes providing that add-ons or derived classes do not include the WavePlayer objects, libraries or include files themselves.

•	A license permitting distribution of modified source and/or libraries providing that the recipient of the distribution has or obtains the required license from Lighthouse Engineering. (i.e. if the recipient is to receive modifed WavePlayer source, they must have or obtain either a Source Code License or Developer's License from Lighthouse Engineering.) Only one equivelent license is required regardless of the number of copies of your enahncements they are receiving.

•	Unlimited free support via telephone or CompuServe

•	Free updates to any and all future version 1.XX releases. (A minimal disk and shipping charge may apply)

•	Substantial discounts on any major version releases of WavePlayer or on other Lighthouse Engineering software releases.

Please register today and support the further development of WavePlayer and other Lighthouse Engineering shareware products. The shareware concept can only work with your support.

How To Register

•	By Check (Cheque)

To register your copy of WavePlayer by check, cheque or money order, make your check out in the US funds in the correct amount payable to Lighthouse Engineering and mail to:

Lighthouse Engineering
5055 Pleasant Valley Rd.
Virginia Beach, Virginia 23464-6005
(USA)

Your registered copy of WavePlayer will be shipped via First Class mail upon approval of the funds. Customers outside the continental United States add $5 per copy (US) for shipping and handling.

For rush delivery anywhere within the continental United States, make your payment by certified check or money order and include an additional $9.95 per copy in US funds to cover the expense of rush delivery. Your copy of the registered version will be shipped immediately upon receipt of payment via UPS Overnight, Overnight Mail or Federal Express depending on the time of receipt and the destination.

For rush delivery outside the US, determine the best delivery method (available on our end) and the associated shipping costs in US funds plus $5 handling. Include shipping details with your order and certified payment for the full amount. Your order will be shipped immediately upon receipt.

•	Via CompuServe

To register your copy of WavePlayer via CompuServe, GO SWREG and search for the title WavePlayer. There should be three listings, one for each license listed above. Select the license(s) you want and follow the directions provided by CIS. Upon receipt of verification from CIS, your registered copy will be shipped via ground. There is a $5 handling charge for registration via CIS.

If you need the registered version in a hurry, send an E-Mail message to K. Scott Piel (74151,1035) requesting an electronic transfer. We will immediately upload the software via file mail, including all source, binaries and electronic documentation upon receipt of notice from CompuServe that your account has been properly billed. The printed documentation and disk will follow by ground mail. We will reverse charges for the upload which will be billed to your CompuServe account by CompuServe.

Order Form


Order Form
WavePlayer Order Form

Complete and mail this form, along with full payment to:

Lighthouse Engineering
5055 Pleasant Valley Rd
Virginia Beach, VA 23464-6005
(USA)

Make your check payable in US funds to: Lighthouse Engineering

WavePlayer Registration

Your Name	____________________________________________
Company Name	____________________________________________
Address:	____________________________________________
____________________________________________
____________________________________________

Redistribution Licenses	____ X $15ea (US)	_______
Source Code Licenses	____ X $25ea (US)	_______
Developer's License	____ X $35ea (US)	_______

Shipping method	__Continental Ground   N/C	_______
__ Foreign Ground $5.00
__ Continental Rush $9.95ea
__ Foreign Rush $_______ea

Total:	_______

How did you hear about WavePlayer?

Did you have to pay for your evaluation copy?

If yes, how much?

Where did you get WavePlayer From?

Comments:


WavePlayer Class Reference

Include Files

 Class Definition (wavplayr.hpp)

 Resource Include (wavplayr.rc)

 Resource Header (wavplayr.rh)

 Wave Sound Files (*.wav)

 WavePlayer Class Library (wavplayr.lib)

 WavePlayer Class Help Include (wavplayr.hh)

 wpDemo Example Application

Class Construction/Destruction

 Constructor: WavePlayer( ... )

 Destructor:: ~WavePlayer()

Playing Wave Sounds

 A single resource: Execute( unsigned )

 A series of resources: Execute( unsigned * )

 A single file: Execute( char * )

 A series of files: Execute( char ** )

 Player Errors: LastError() / enum wpErrors

Converting Numbers To Words

 Integer Numbers: CvtNumToSndStr( long, wpSigns )

 Real Numbers: CvtNumToSndStr( double, int, wpSigns )

 Playing numbers from file: CvtSndStrToFileList( unsigned * )

 Enunciator Sign Options

Sample WavePlayer Source

 Example Application Using WavePlayer

 Example WavePlayer Class Source


Class Definition
Class Definition Header

This header, WAVPLAYR.HPP,  should be included in any source files within your application which make use of the WavePlayer class or it's constants. Including this header will automatically include the resource constants header WAVPLAYR.RH. The resource header is only required if you need direct access to the resources WavePlayer provides.

Compile Time Options

•	wpUSES_OWL

This define controls the use of OWL 2 classes within the WavePlayer library. If the define is used, WavePlayer will make calls to TApplication::PumpWaitingMessages() while sounds are being played in order to offer Windows the ability to continue handling messages while the sound plays. Further, defining this value will automatically include <owl\applicat.h> in the WavePlayer sources. Commenting out this define defines a dummy TApplication class to support the associated code in the source. It will also disable the ability of WavePlayer to permit Windows to handle messages while sounds are being played.

•	wpEXCLUDE_FILES

WavePlayer contains a list of wave files that correspond to the sound resources used to enunciate numbers. This list is used to convert a string of resource IDs for a given number into a string of file names to be played via the Execute( char ** ) method. If you do not want to use files, you can remove the constant strings from your linked program by defining wpEXCLUDE_FILES.

NOTE: Since the shareware evaluation version of WavePlayer is precompiled and you do not have source available, you can not change either of these values. For the purposes of evaluation, the library is built with both OWL support and the file list included.

Enumerated Constants

•	enum wpErrors

The wpErrors enumerated type defines the list of result codes for calls to Execute(). Each call to Execute will change the value of the last error either to wpNOERROR if the sounds played without incident or to indicate the last error encountered while playing a single sound or list of sounds. If playing a list, there might have been more than one error encountered, the code returned is the last error prior to the method's return.

wpNOERROR	No error was detected in the last call
wpNOTFOUND	A resource or file requested was missing
wpLOADFAILED	A resource or file would not fit in global memory
wpLOCKFAILED	Global memory for a resource or file could not be locked
wpPLAYFAILED	sndPlaySound returned FALSE

•	enum wpSigns

The wpSigns enumerated type defines the different means by which the sign of numbers is enunciated.

wpUNSIGNED	The value is to be treated as an unsigned number
wpNEGATIVE	Use "negative" only for numbers less than zero
wpPOSITIVE	Announce number as "positive" or "negative"
wpMINUS	Use "minus" only for numbers less than zero
wpPLUS	Announce number as "plus" or "minus"

Regardless of the value of wpSigns used, no announcement is made for numbers that are equal to zero.

Listing of WAVPLAYR.HPP

//----------------------------------------------------------------------------
// WavePlayer Class Include File
//
// Version 1.00
// Copyright (C) 1994 by Lighthouse Engineering
// All Rights Reserved
//
// Written by K. Scott Piel - CIS 74151,1035
//----------------------------------------------------------------------------

#ifndef WAVPLAYR_HPP
#define WAVPLAYR_HPP

#include "wavplayr.rh"

//----------------------------------------------------------------------------
// Comment out this define if you do not want to use OWL libraries with this
// build of WavePlayer
//----------------------------------------------------------------------------

#define wpUSES_OWL

//----------------------------------------------------------------------------
// comment out this define if you want to exclude the WavePlayer file list
// of numbers from the compile. This will reduce memory usage.
//----------------------------------------------------------------------------

//#define wpEXCLUDE_FILES

//----------------------------------------------------------------------------
// Valid error codes set by Execute when called.
//----------------------------------------------------------------------------

enum wpErrors
{
wpNOERROR,	// the last call was completed w/o error
wpNOTFOUND,	// the resource or file was not found
wpLOADFAILED,	// the wave could not be loaded into memory
wpLOCKFAILED,	// the global memory image could not be locked
wpPLAYFAILED	// the wave would not play
};

//----------------------------------------------------------------------------
// Enumerated control of sign announcement for spoken numbers
//----------------------------------------------------------------------------

enum wpSigns
{
wpUNSIGNED,	// number is unsigned, use no prefixing
wpNEGATIVE,	// announce numbers as "negative", do not use "positive"
wpPOSITIVE,	// announce numbers as "positive" and "negative"
wpMINUS,	// announce numbers as "minus", do not use "plus"
wpPLUS	// announce numbers as "plus" and "minus"
};

//----------------------------------------------------------------------------
// Dummy TApplication class used to replace references if OWL is not used
//----------------------------------------------------------------------------

#ifndef wpUSES_OWL

class TApplication
{
public:

TApplication() {};
~TApplication() {};
};

#else

#include <owl\applicat.h>

#endif // wpUSES_OWL

//----------------------------------------------------------------------------
// Wave player class definition
//----------------------------------------------------------------------------

class WavePlayer
{
private:

TApplication	*app;	// application that owns this instance
HINSTANCE	instance;	// current application instance number
wpErrors	err_code;	// last error code generated
BOOL	playsound;	// FALSE is no sound device available

public:

WavePlayer( HINSTANCE hInst, TApplication *parent = NULL );
~WavePlayer();

BOOL	Execute( char *filename ); 	// a single wave file
BOOL	Execute( char **filelist );	// a list of wave files
BOOL	Execute( unsigned resource_id );// a single wave resource
BOOL	Execute( unsigned *rsrclist );	// a list of resources

wpErrors	LastError( void );	// last error code

// convert numbers to a list of WavePlayer resources to be spoken

unsigned *CvtNumToSndStr( long val, wpSigns signed = wpUNSIGNED );

unsigned *CvtNumToSndStr(
double val, int precsn, wpSigns signed = wpUNSIGNED
);

// convert a list of wave resources to a list of wave files

char **CvtSndStrToFileList( unsigned *sndstr );
};

#endif // WAVPLAYR_HPP

//--- End Of File ------------------------------------------------------------


Resource Include
WavePlayer Resource Include

The WavePlayer resource incude file WAVPLAYR.RC is intended to be #included into your application's .RC file. Including this file in your resource file will load the WavePlayer wave files, used by the number conversion methods, into your program's resource section. This permits WavePlayer to enunciate numbers from the program's resources without having to distribute all of the .WAV files with your program.

You do not, however, have to include WAVPLAYR.RC in your resource file. If you do not include it, any attempt to enunciate a number specified by a resource Id string will result in a wpNOTFOUND error. You will, first, have to convert the resource ID string into a file list string via CvtSndStrToFileList( unsigned * ). This will permit you to enunciate numbers from disk.

Defining Your Own Wave Resources

WavePlayer permits you to define your own wave resources to be stored in your program's resource file. This permits you to distribute your own wave resources bundled into the executable, along with WavePlayer's, without having to distribute the wave files themselves. Use the following format in order to add your own wave resources to your application, for use with WavePlayer.

<resource_id>    wpWAVEDATA    <"filename.ext">

In order to locate user defined resources for use by WavePlayer, it searches for the resource type wpWAVEDATA. The resource Id is a #defined integer value. This value should be defined in your program's .RH file. Also note that WavePlayer defines two constants wpFIRSTID and wpLASTID. These are the first and last resource IDs used by WavePlayer. You can locate the first available ID for your own wave resources by using wpLASTID+1.

NOTE: In the shareware evaluation version of WavePlayer, the first ID is preset to 2000 and can not be altered. This is modifiable in the registered version of WavePlayer.

Example:

// in myapp.rh

#include "wavplayr.rh"

#define	IDW_HELLO	wpLASTID+1
#define	IDW_WORLD	wpLASTID+2

// in myapp.rc

#include "myapp.rh"

IDW_HELLO	wpWAVEDATA	"hello.wav"
IDW_WORLD	wpWAVEDATA	"world.wav"

How To Add WavePlayer Resources To Your's

WavePlayer comes with a set of predefined wave resources which permit you to enunciate numbers from memory and bundle the wave data required to do so into the executable of your program. In order to do this, you need to set up your application's .RH and .RC files as follows.

Example:

// in myapp.rh

#include "wavplayr.rh"

// in myapp.rc

#include "myapp.rh"
#include "wavplayr.rc"

Listing Of WAVPLAYR.RC

//----------------------------------------------------------------------------
// WavePlayer Class Resource Script
//
// Version 1.00
// Copyright (C) 1994 by Lighthouse Engineering
// All Rights Reserved
//
// Written by K. Scott Piel - CIS 74151,1035
//----------------------------------------------------------------------------

ID_wp_ZERO     	wpWAVEDATA "zero.wav"
ID_wp_ONE      	wpWAVEDATA "one.wav"
ID_wp_TWO      	wpWAVEDATA "two.wav"
ID_wp_THREE    	wpWAVEDATA "three.wav"
ID_wp_FOUR     	wpWAVEDATA "four.wav"
ID_wp_FIVE     	wpWAVEDATA "five.wav"
ID_wp_SIX      	wpWAVEDATA "six.wav"
ID_wp_SEVEN    	wpWAVEDATA "seven.wav"
ID_wp_EIGHT    	wpWAVEDATA "eight.wav"
ID_wp_NINE     	wpWAVEDATA "nine.wav"
ID_wp_TEN      	wpWAVEDATA "ten.wav"
ID_wp_ELEVEN   	wpWAVEDATA "eleven.wav"
ID_wp_TWELVE   	wpWAVEDATA "twelve.wav"
ID_wp_THIRTEEN 	wpWAVEDATA "thirteen.wav"
ID_wp_FOURTEEN 	wpWAVEDATA "fourteen.wav"
ID_wp_FIFTEEN  	wpWAVEDATA "fifteen.wav"
ID_wp_SIXTEEN  	wpWAVEDATA "sixteen.wav"
ID_wp_SEVENTEEN	wpWAVEDATA "sevnteen.wav"
ID_wp_EIGHTEEN 	wpWAVEDATA "eighteen.wav"
ID_wp_NINETEEN 	wpWAVEDATA "nineteen.wav"

ID_wp_TWENTY   	wpWAVEDATA "twenty.wav"
ID_wp_THIRTY   	wpWAVEDATA "thirty.wav"
ID_wp_FOURTY   	wpWAVEDATA "fourty.wav"
ID_wp_FIFTY    	wpWAVEDATA "fifty.wav"
ID_wp_SIXTY    	wpWAVEDATA "sixty.wav"
ID_wp_SEVENTY  	wpWAVEDATA "seventy.wav"
ID_wp_EIGHTY   	wpWAVEDATA "eighty.wav"
ID_wp_NINETY   	wpWAVEDATA "ninety.wav"

ID_wp_HUNDRED  	wpWAVEDATA "hundred.wav"
ID_wp_THOUSAND 	wpWAVEDATA "thousand.wav"
ID_wp_MILLION  	wpWAVEDATA "million.wav"
ID_wp_BILLION  	wpWAVEDATA "billion.wav"

ID_wp_POSITIVE	wpWAVEDATA "positive.wav"
ID_wp_NEGATIVE	wpWAVEDATA "negative.wav"
ID_wp_PLUS	wpWAVEDATA "plus.wav"
ID_wp_MINUS	wpWAVEDATA "minus.wav"
ID_wp_POINT	wpWAVEDATA "point.wav"

//--- End Of File ------------------------------------------------------------


Resource Header
WavePlayer Resource Header

The WavePlayer resource header, WAVPLAYR.RH, defines the constant values used by the class. You do not have to include this header in your resource file if you are not going to use the WavePlayer wave files in your resource. If you include WAVPLAYR.HPP in your program's source files, it will automatically include this header. However, it is not mandatory for your program to be aware of these constants (they are, obviously, mandatory for the WavePlayer source files). Therefor, if you have no need to access these constants or the resources that WavePlayer provides, you can leave this file out.

That aside, these values are critical to the WavePlayer class and should not be altered or modified, in any way, with the exception of the single constant wpFIRSTID which is used to determine the starting ID number for WavePlayer resources. You can customize your build of WavePlayer by altering this value.

Important WavePlayer Resource Constants

•	wpFIRSTID

This value defines the first resource ID number used by the WavePlayer class resources. By default, it is set to 2000. You can use any value you like as the base ID.

NOTE: In the shareware evaluation version of WavePlayer, these constants have been predefined when the library was built. Since you do not have access to the WavePlayer source, this value can not be changed.

•	wpLASTID

This value defines the last resource ID number used by the WavePlayer class resources. You are free to use any value from wpLASTID+1 on. Values between wpFIRSTID and wpLASTID (inclusive) are reserved for use by WavePlayer.

•	ID_wp_???????

These constants define the resources used to enunciate numbers. They are also used to translate a string of sound resources into a list of equivelent .wav files for enunciating numbers from disk. These values are EXTREAMLY order dependant and should not be altered from their current definition.

Listing of WAVPLAYR.RH

//----------------------------------------------------------------------------
// WavePlayer Resource Script Include File
//
// Version 1.00
// Copyright (C) 1994 by Lighthouse Engineering
// All Rights Reserved
//
// Written by K. Scott Piel - CIS 74151,1035
//----------------------------------------------------------------------------

#ifndef WAVPLAYR_RH
#define WAVPLAYR_RH

//----------------------------------------------------------------------------
// set wpFIRSTID to control the range of values used by the WavePlayer class
// resource. The value of wpLASTID can be used to find the last ID used by the
// WavePlayer class resources.
//
// NOTE: This value must be the same value as was used to build the class
// source. Altering the value from the class library value will be bad news.
//----------------------------------------------------------------------------

#define wpFIRSTID	2000

//----------------------------------------------------------------------------
// do not alter these constants!
//----------------------------------------------------------------------------

#define ID_wp_ZERO      wpFIRSTID+0
#define ID_wp_ONE       wpFIRSTID+1
#define ID_wp_TWO       wpFIRSTID+2
#define ID_wp_THREE     wpFIRSTID+3
#define ID_wp_FOUR      wpFIRSTID+4
#define ID_wp_FIVE      wpFIRSTID+5
#define ID_wp_SIX       wpFIRSTID+6
#define ID_wp_SEVEN     wpFIRSTID+7
#define ID_wp_EIGHT     wpFIRSTID+8
#define ID_wp_NINE      wpFIRSTID+9
#define ID_wp_TEN       wpFIRSTID+10
#define ID_wp_ELEVEN    wpFIRSTID+11
#define ID_wp_TWELVE    wpFIRSTID+12
#define ID_wp_THIRTEEN  wpFIRSTID+13
#define ID_wp_FOURTEEN  wpFIRSTID+14
#define ID_wp_FIFTEEN   wpFIRSTID+15
#define ID_wp_SIXTEEN   wpFIRSTID+16
#define ID_wp_SEVENTEEN wpFIRSTID+17
#define ID_wp_EIGHTEEN  wpFIRSTID+18
#define ID_wp_NINETEEN  wpFIRSTID+19

#define ID_wp_TWENTY    wpFIRSTID+20
#define ID_wp_THIRTY    wpFIRSTID+21
#define ID_wp_FOURTY    wpFIRSTID+22
#define ID_wp_FIFTY     wpFIRSTID+23
#define ID_wp_SIXTY     wpFIRSTID+24
#define ID_wp_SEVENTY   wpFIRSTID+25
#define ID_wp_EIGHTY    wpFIRSTID+26
#define ID_wp_NINETY    wpFIRSTID+27

#define ID_wp_HUNDRED   wpFIRSTID+28
#define ID_wp_THOUSAND  wpFIRSTID+29
#define ID_wp_MILLION   wpFIRSTID+30
#define ID_wp_BILLION   wpFIRSTID+31

#define ID_wp_POSITIVE  wpFIRSTID+32
#define ID_wp_NEGATIVE  wpFIRSTID+33
#define ID_wp_PLUS      wpFIRSTID+34
#define ID_wp_MINUS     wpFIRSTID+35
#define ID_wp_POINT     wpFIRSTID+36

#define wpLASTID	ID_wp_POINT

#endif  // WAVPLAYR_RH

//--- End Of File ------------------------------------------------------------


Wave Sound Files

WavePlayer comes with a collection of .wav sound files. These files contain the sound data that is passed to the sndPlaySound() function to be played by Windows. WavePlayer permits you to plays these files from disk or to bundle them into you application's resource file. In this manner you can reduce the size of the executable by distributing it using the file playback form of WavePlayer, or you can simplify the distribution by bundling the files as resources and playing them from memory. In this way, you do not have to distribute all of the .wav files with the program.

The files used by WavePlayer are all of the files ending in .wav with a number as the primary file name (i.e. one.wav, two.wav, etc.), point.wav, plus.wav, minus.wav, positive.wav, negative.wav, hundred.wav, thousand.wav, million.wav and billion.wav - all other .wav files are excess baggage used by the example programs and are not required to develop apps using WavePlayer.

.WAV File Format Supplied Here

In order to maintain maximum compatability with the various and sundry machines this shareware evaluation verions of WavePlayer might be used on, all of the .WAV files provided with this distribution are eight bit, mono data. Also, in order to keep the distribution small, all of the data was recorded at a sampling rate of 11025hz. Obviously, the sound quality would be greatly improved by using 16bit stereo at a higher sampling rate. Feel free to try replacing some of the .WAV files provided with higher quality files of your own to see the difference.

Changing WavePlayer's Voice

I have one of those deep voices from you know where and some may find the "voice" of WavePlayer not to their liking. You are quite welcome to replace my voice with your's or anyone else's you might prefer. A soft female voice might be best. In order to do so, use a voice recorder that uses the .WAV format to replace the files provided. You must, however, use the same file names as the shareware evaluation version of WavePlayer is prebuilt using those names provided and you do not have access to the source to change those definitions.

It is highly recommended that you use a voice recorder that has the ability of normalizing the .WAV data... in this way the volume of the segments remains constant and the "sentences" don't seem to rise and fall so much.

NOTE: Do not redistribute this evaluation copy of WavePayer with altered .WAV files. (See the licensing agreement) The distribution copy of this library must not be altered.


WavePlayer Class Library

Included with this shareware evaluation version of WavePlayer is a sample WavePlayer class library, WAVPLAYR.LIB. You are welcome to use this library to play with the class abilities and test-drive the WavePlayer class for a period of up to thirty (30) days as per the License Agreement included in this package. Bear in mind that you can not distribute any of your "test" programs without obtaining a Redistribution License or Developer's License.

This library was created using the large model OWL target type. To use it in a project you are working on, add the file WAVPLAYR.LIB as a <BinaryInclude> node of the executable you are creating. You will need to include the WAVPLAYR.HPP file, at a minimum, in your test program's source files. You may also need to include WAVPLAYR.RH and WAVPLAYR.RC in your test program's .RC resource source file. The .wav files distributed with this package will also need to be in your source directory if you use the WAVPLAYR.RC file.


Help Header
WavePlayer Help Header

The WavePlayer Help Header, WAVPLAYR.HH, lists the jump topic labels and context IDs used by this help file. You are welcome to use this inforomation to provide hot links in your tools or in any test programs you are working on with this demo.

Listing of WAVPLAYR.HH

//----------------------------------------------------------------------------
// WavePlayer Class Help Context ID Include File
//
// Version 1.00
// Copyright (C) 1994 by Lighthouse Engineering
// All Rights Reserved
//
// Written by K. Scott Piel - CIS 74151,1035
//----------------------------------------------------------------------------

#ifndef WAVPLAYR_HH
#define WAVPLAYR_HH

#define Contents  	10000
#define Overview  	11000
#define Licensing_Agreement  	12000
#define Registering_WavePlayer  	13000
#define Order_Form  	13010
#define WavePlayer_Class_Reference  	14000
#define Class_Definition  	14010
#define Resource_Include  	14020
#define Resource_Header  	14030
#define Wave_Sound_Files  	14040
#define WavePlayer_Class_Library  	14050
#define Help_Header  	14060
#define wpDemo_Example_Application  	14070
#define Constructor  	14080
#define Destructor  	14090
#define Execute_Single_Resource  	14100
#define Execute_Multiple_Resources  	14110
#define Execute_Single_File  	14120
#define Execute_Multiple_Files  	14130
#define Error_Reporting  	14140
#define Convert_Integer_To_Sound_String  	14150
#define Convert_Real_To_Sound_String  	14160
#define Convert_Sound_String_To_File_List  	14170
#define Enunciator_Sign_Options  	14180
#define wpUNSIGNED  	14181
#define wpMINUS  	14182
#define wpPLUS  	14183
#define wpNEGATIVE  	14184
#define wpPOSITIVE  	14185
#define Example_Application_Using_WavePlayer	14190
#define Example_WavePlayer_Class_Source  	14200
#define Getting_Help  	15000
#define Index  	16000
#define Glossary  	17000

#endif // WAVEPLAYR_HH

//--- End Of File ------------------------------------------------------------


wpDemo Example Application

Included with this demo is an example program which demonstrates the ease of using the WavePlayer class and some of it's capabilities. The required file list is given below.

Compiling the example program

1 	Start up the Borland IDE

2 	Create a new project: wpdemo.ide

3 	Run the target expert and make sure the target app, wpdemo.exe, is an OWL application in large model.

4 	Add the following nodes to the .exe target

wpdemo.cpp
wavexmpl.cpp
aboutdlg.cpp
wavplayr.lib
wpdemo.rc
wpdemo.def

5 	If you like, you should be able to run rescan on the demo without any problems. You can then use the Class Expert to explore the demo. The key code sections are in the Play File menu handler in wpdemo.cpp and the bnClickedSayIt handler in the wavexmpl.cpp file.

6 	Select Project/Build All to compile the app. It should compile and link without error or warning. (At least it did here! <g>)

Aside from the files listed above as nodes in the IDE project file, you will need the following to build the application.

Source Files:

aboutdlg.h	wavexmpl.h	wpdemo.h	wpdemo.rc
wpdemo.rh	wavplayr.hpp	wavplayr.rc	wavplayr.rh
wavplayr.hh

Resources:

zero.wav	one.wav	two.wav	three.wav
four.wav	five.wav	six.wav	seven.wav
eight.wav	nine.wav	ten.wav	eleven.wav
twelve.wav	thirteen.wav	fourteen.wav	fifteen.wav
sixteen.wav	seventeen.wav	eighteen.wav	nineteen.wav
twenty.wav	thirty.wav	fourty.wav	fifty.wav
sixty.wav	seventy.wav	eighty.wav	ninety.wav
hundred.wav	thousand.wav	million.wav	billion.wav
plus.wav	minus.wav	positive.wav	negative.wav
point.wav	message.wav	wpdemo.ico	wavplayr.bmp

Running the example program

1 	Press Alt-F9 to execute the program from the IDE

2 	Select the File/Play File option in the menu to play a wave resource from disk. This demonstrates the Execute( char * ) method.

3 	Select the File/Say Number option. The program will "tell" you to enter a number and "I" will say it. (actually I guess I really am... sorry my voice is so deep, kinda makes the speakers rattle if the volume's too high <g>)

4 	From here you can play with all sort of options. You can "speak" the number from disk or from the executable's resources, use integer or real numbers, specify what precision you want to hear and how to announce the signs of the numbers being enunciated. When you've got everything the way you want it, click Say It! and the program will do just that. When you're done playing with my vocal cords, click on Close.

5 	To end the demo, select File/Exit or press Alt-F4.


Constructor
WavePlayer(HINSTANCE,TApplication*)

Description

This is the constructor method for the WavePlayer class. If the define wpUSES_OWL is defined, you must pass a valid pointer to an instance of TApplication. Otherwise, the default value of NULL is all that is required.

Syntax

WavePlayer::WavePlayer( HINSTANCE inst, Tapplication *app = NULL )

Arguments

•	HINSTANCE	inst

The handle for this instance of the application. used to locate resources. Typlically obtained from the global variable _hInstance

•	TApplication	*app

Pointer to the instance of the TApplcation class to which this instance of the WavePlayer belongs. This is required only if wpUSES_OWL is defined.

Return Values

•	none

Examples

WavePlayer	Player( _hInstance, MyApp );
WavePlayer	*PlayerPtr = new WavePlayer( _hInstance, MyApp );


Destructor
~WavePlayer()

Description

This is the default destructor for the WavePlayer class.

Syntax

WavePlayer::~WavePlayer()

Arguments

•	none

Returns

•	none

Examples

WavePlayer	*PlayerPtr = new WavePlayer( _hInstance, MyApp );

delete PlayerPtr;


Execute Single Resource
Execute( unsigned )

Description

This method is the paralell to the Execute( char * ) method and plays a single wave sound from the program's resources. If wpUSES_OWL is defined, the program will not regain control until the sound has finished playing, however, Windows will be able to continue processing messages while the sound plays. If wpUSES_OWL is not defined, both the program and Windows must wait for the sound to finish playing before either can continue processing.

Resources are located by looking for the resource type wpWAVEDATA in the program's resource file.

Syntax

BOOL WavePlayer::Execute( unsigned resid )

Arguments

•	unsigned	resid

The user defined windows resource ID for the wave resource to be played. Typically this resource is defined in application.rh and the resource is included in application.rc.

Returns (BOOLEAN)

•	TRUE

The call was processed without a detected error, LastError() will return wpNOERROR.

•	FALSE

An error was encountered trying to satisfy the request. LastError() will return the cause of the error...

wpNOTFOUND	The resource was not located in the resource data
wpLOADFAILED	The resource could not be loaded into global memory
wpLOCKFAILED	The global memory could not be locked
wpPLAYFAILED	sndPlaySound() returned FALSE

Examples

WavePlayer	Player( _hInstance, MyApp );
BOOL	result;

result = Player.Execute( ID_MYSOUND );

if( !result ) PlayFailed( Player.LastError() );


Execute Multiple Resources
Execute( unsigned * )

Description

This method is the paralell of the Execute( char ** ) method and plays a list of wave sourds from the program's resources. In the shareware evaluation version of WavePlayer, neither Windows nor your program will regain control until the last sound has been played. This method uses optimized prefetching of the resources... that is, the method will locate, load and lock as many entries in the list as system resources will permit. The loaded sounds are then played in sequence and released. If any more sounds remain to be loaded, the process repeats, otherwise it returns to the caller.

Any resource which will not fit in memory or can not be played will be ignored. Thus, it is possible that a sentence will "miss" a word, though this should not happen and is most likely due to a programming error such as a missing resource or invalid ID. The other possibility would be a wave resource too large to fit in memory on it's own. In this case, try breaking it into more than one piece and chaining the pieces together. The method will make two attempts to load any given resource and only gives up if both attempts fail. On the other hand, it will only make one attempt to play a resource that has been loaded and locked.

Resources are located by looking for the resource type wpWAVEDATA in the program's resource file.

Syntax

BOOL WavePlayer::Execute( unsigned *residlist )

Arguments

•	unsigned*	residlist

This is a pointer to an array of unsigned integers. Each element of the array is made up of the resource ID for a wpWAVEDATA item to be played. The last entry in the list must be NULL (0). The program will execute the list from left to right (residlist[0] to residlist[n]) until it encounteres the NULL terminator. Ownership of the list belongs to the caller.

Returns (BOOLEAN)

•	TRUE

The call was processed without a detected error, LastError() will return wpNOERROR.

•	FALSE

An error was encountered trying to satisfy the request. LastError() will return the cause of the error... if more than one error was encountered, the value will be the last one experienced.

wpNOTFOUND	A resource was not located in the resource data
wpLOADFAILED	A resource could not be loaded into global memory
wpLOCKFAILED	A global memory block could not be locked
wpPLAYFAILED	sndPlaySound() returned FALSE for a resource

Examples

WavePlayer	Player( _hInstance, MyApp );
unsigned	playlist[3];
BOOL	result;

playlist[0] = IDW_HELLO;
playlist[1] = IDW_WORLD;
playlist[2] = 0;

result = Player.Execute( playlist );

if( !result ) PlayFailed( Player.LastError() );


Execute Single File
Execute A Single File

Description

This method is the paralell to the Execute( unsigned ) method and plays a single wave sound from the file system. If wpUSES_OWL is defined, the program will not regain control until the sound has finished playing, however, Windows will be able to continue processing messages while the sound plays. If wpUSES_OWL is not defined, both the program and Windows must wait for the sound to finish playing before either can continue processing.

The method passes this name on to sndPlaySound and the location rules for the file, therefor, are those specified by sndPlaySound

Systax

BOOL WavePlayer::Execute( char *filename )

Arguments

•	char*	filename

This is a pointer to the asciiz terminated string giving the name of the file, drive and directory path are optional.

Returns (BOOLEAN)

•	TRUE

The call was processed without a detected error, LastError() will return wpNOERROR.

•	FALSE

An error was encountered trying to satisfy the request. LastError() will return the cause of the error... The shareware evaluation version of WavePlayer does not try to prefetch files, it simply passes the filename on to sndPlaySound, therefor the only error code available is wpPLAYFAILED.

wpPLAYFAILED	sndPlaySound() returned FALSE

Examples

WavePlayer	Player( _hInstance, MyApp );
BOOL	result;

result = Player.Execute( "hello.wav" );

if( !result ) PlayFailed( Player.LastError() );


Execute Multiple Files
Execute( char ** )

Description

This method is the paralell of the Execute( unsigned * ) method and plays a list of wave sourds from the file system. In the shareware evaluation verson of WavePlayer, neither Windows nor your program will regain control until the last sound has been played. In this sharewave evaluation version of WavePlayer, the method does not use optimized prefetching of the files.

Syntax

BOOL WavePlayer::Execute( char **filelist )

Arguments

•	char**	filelist

This is a pointer to a NULL terminated array of of ponters. Each element of the array is made up of a pointer to an asciiz terminated string representing the name of the file to be played. A drive and directory are optional. File location is according to the rules established by the sndPlaySound function. The program will execute the list from left to right (filelist[0] to filelist[n]) until it encounteres the NULL terminator. Ownership of the list belongs to the caller.

Returns (BOOLEAN)

•	TRUE

The call was processed without a detected error, LastError() will return wpNOERROR.

•	FALSE

An error was encountered trying to satisfy the request. LastError() will return the cause of the error... if more than one error was encountered, the value will be the last one experienced.

wpNOTFOUND	A resource was not located in the resource data
wpLOADFAILED	A resource could not be loaded into global memory
wpLOCKFAILED	A global memory block could not be locked
wpPLAYFAILED	sndPlaySound() returned FALSE for a resource

NOTE: The shareware evaluation version of WavePlayer does not prefetch files. Thus, the only applicable error codes as wpNOERROR and wpPLAYFAILED if sndPlaySound() can't play the file.

Examples

WavePlayer	Player( _hInstance, MyApp );
char*	filelist[3];
BOOL	result;

filelist[0] = "hello.wav";
filelist[1] = "world.wav";
filelist[2] = 0;

result = Player.Execute( filelist );

if( !result ) PlayFailed( Player.LastError() );


Error Reporting
LastError()

This method returns the last error encountered by this instance the WavePlayer class. Upon creation of theinstance the error code is set to wpNOERROR and will remain so until an error is encountered. In the event of an error, the method will return the last error experienced. Any call to Execute() will reset the state of the error reporting (i.e. it will replace the last error code with whatever completion status it appropriate, including wpNOERROR)

Syntax

wpErrors WavePlayer::LastError()

Arguments

•	none

Returns (enum wpErrors)

•	wpNOERROR

The last call to Execute() completed without a detected error.

•	wpNOTFOUND

A requested resource could not be found in the program's resource file or the specified file was not found in the file system. Possible causes include an invalid resource ID, an invalid resource type (WavePlayer looks for wpWAVEDATA resources) or an invalid file specifier.

•	wpLOADFAILED

WavePlayer attempted to load the resource, or file, into global memory and received an error response in turn. This will generally be the result of limited global resources or a resource that is quite large and should be broken into smaller parts.

•	wpLOCKFAILED

This error should be quite rare, but generally paralells the wpLOADFAILED error. If WavePlayer attempts to lock a global resource to obtain a pointer to the resource and receives a NULL pointer, this error is set.

•	wpPLAYFAILED

This error is set when sndPlaySound() returns FALSE and would generally be caused by an invalid resource item (i.e. the wpWAVEDATA resource is not wave data) or inthe case of the shareware evaluation version of WavePlayer, may be the result of a missing file if using Execute( char * ) or Execute( char ** ) as both of these methods are simply passing the file on to sndPlaySound().

Examples

WavePlayer	Player( _hInstance, MyApp );
wpErrors	error_code;

if( Player.Execute( IDW_HELLOWORLD ) == FALSE )
{
error_code = Player.LastError();
ShowErrorMessageAndCode( "Sound Play Failed", error_code );
}


Convert Integer To Sound String
CvtNumToSndStr( long, wpSigns )

This method is the parallel to CvtNumToSndStr( double, int, wpSigns ) and accepts a long integer value in order to converts it into a list of WavePlayer resource IDs required to enunciate the value as words. How the numnber is treated depends upon the value of wpSigns. You can typecaste any type up to, and including, unsigned long to long and pass it into this method.

The method returns a pointer to an array of unsigned integers derived via new unsigned[n]. Ownership of this pointer belongs to the caller and it is the caller's responsibility to delete the array when done with it.

Syntax

unsigned *WavePlayer::CvtNumToSndStr( long val, wpSigned sign )

Arguments

•	long	val

This is an integer value to be interpreted into an equivelent list of words. If the signs value is wpUNSIGNED, the value is treated as an unsigned long or, more precicely as a four byte binarey value. Thus, -1 would be interpreted as 0xFFFFFFFFl in hexidecimal, which is, obviously, a very large number. Otherwise, the value is treated as a signed long integer.

•	wpSigns	sign

This value defines how the number passed in val should be translated...

wpUNSIGNED	the value is an unsigned long, no signs are used

If the value is not wpUNSIGNED, WavePlayer will prefix the list of words with a word stating the sign of the number as follows

wpNEGATIVE	if the value is less than zero, prefix with "negative"
wpPOSITIVE	prefix with "positive" or "negative unless val = 0
wpMINUS	if the value is less than zero, prefix with "minus"
wpPLUS	prefix with "plus" or "minus" unless val = 0

Returns (unsigned *)

•	A pointer to a NULL terminated array of unsigned integers representing the resource IDs required to "say" the number. The IDs appear in order from most significant digit to least significant digit with the last value being NULL (0) to mark the end of the list. This pointer is obtained via new unsigned[N] where N is the number of sounds in the list plus one. Ownership of the pointer belongs to the caller and it is the caller's responsibility to delete the pointer when done with it.

•	NULL if there was not enough free memory for the call to new unsigned[N];

Examples

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 1234567L, wpUNSIGNED );

if( playlist )
{
Player.Execute( playlist );

//----------------------------------------------------
// at this point the program will output the words
//
// "one million two hundred thirty-four thousand five
// hundred sixty-seven"
//----------------------------------------------------

delete playlist;
}
else
{
DisplayMessage( "Not enough memory for play list" );
}


Convert Real To Sound String
CvtNumToSndStr( double, int, wpSigns )

This method is the parallel to CvtNumToSndStr( long, wpSigns ) and accepts a double value in order to converts it into a list of WavePlayer resource IDs required to enunciate the value as words. How the number is treated depends upon the value of wpSigns. You can typecaste any type to double and pass it into this method.

The method returns a pointer to an array of unsigned integers derived via new unsigned[n]. Ownership of this pointer belongs to the caller and it is the caller's responsibility to delete the array when done with it.

Syntax

unsigned *WavePlayer::CvtNumToSndStr( double val, int precisn, wpSigned sign )

Arguments

•	double	val

This is a real (double) value to be interpreted into an equivelent list of words. If the signs value is wpUNSIGNED, the value is treated as an unsigned number and the sign is ignored entirely. Unlike the CvtNumToSndStr( long, wpSignes ) method, this method does not treat the value as a binary value, thus if the value is less than zero the sign is simply ignored. THus, wpUNSIGNED makes this method treat the value as an absolute value. Otherwise, the value is treated as a signed real number. If the precision is set to zero or less, the value is rounded to the nearest whole value and the word "point" is not added to the play list.

•	int	precisn

First, the precision specifies what digit to round the value to. This is done in accordance to the rule that any value >= .5 of the last significant digit is rounded up and the rest are rounded down.

This value also specifies how many digits of precision are desired, or more simply, how many digits to the right of the decimal are to be stated. If this value is less than or equal to zero, the value is treated as an integer and the word "point" is not used. Otherwise, WavePlayer will convert the integer portion of the value to a resource list exaclty as it does for long values. It then appends the word "point" to the list followed by the number of decimal values specified by precisn.

•	wpSigns	sign

This value defines how the number passed in val should be translated...

wpUNSIGNED	the value is an absolute value

If the value is not wpUNSIGNED, WavePlayer will prefix the list of words with a word stating the sign of the number as follows

wpNEGATIVE	if the value is less than zero, prefix with "negative"
wpPOSITIVE	prefix with "positive" or "negative unless val = 0
wpMINUS	if the value is less than zero, prefix with "minus"
wpPLUS	prefix with "plus" or "minus" unless val = 0

Returns (unsigned *)

•	A pointer to a NULL terminated array of unsigned integers representing the resource IDs required to "say" the number. The IDs appear in order from most significant digit to least significant digit with the last value being NULL (0) to mark the end of the list. This pointer is obtained via new unsigned[N] where N is the number of sounds in the list plus one. Ownership of the pointer belongs to the caller and it is the caller's responsibility to delete the pointer when done with it.

•	NULL if there was not enough free memory for the call to new unsigned[N];

Examples

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.4569, 3, wpNEGATIVE );

if( playlist )
{
Player.Execute( playlist );

//----------------------------------------------------
// at this point the program will output the words
//
// "negative one hundred twenty-three point four
// five seven""
//----------------------------------------------------

delete playlist;
}
else
{
DisplayMessage( "Not enough memory for play list" );
}


Convert Sound String To File List
CvtSndStrToFileList( unsigned * )

This method converts a string of resource IDs produced by the CvtNumToSndStr() methods into a list of equvelent wave files in order to enunciate a number from disk in place of using program resources. The list does not have to be generated by CvtNumToSndStr(), but all values in the list must be resources that WavePlayer is familiar with, or more precisely, the values in the list must be such that wpFIRSTID <= value[n] <= wpLASTID. Any values outside this range are simply ignored.

This method makes it posible for you to distribute appllications that enunciate numbers without bundling the .WAV resources into the executable. To do this, however, all of the corresponding .wav files must be distributed with the executable.

Further, for this method to function, the define wpEXCLUDE_FILES must not be #defined. If this devine is present, this function does nothing.

Syntax

char **WavePlayer::CvtSndStrToFileList( unsigned *residlist )

Arguments

•	unsigned*	residlist

This is a pointer to a null (0) terminated array of unsigned integers in the range wpFIRSTID <= residlist[n] <= wpLASTID. Any value outside this range is ignored. The last entry in the array must be zero (0) in order to mark the end of the list. This pointer would normally be one returned by one of the CvtNumToSndStr() methods, but may be a user defined string.

Returns (char **)

•	A pointer to a NULL terminated array of pointers. Each element of the array points to a filename that corresponds to the resource ID in the passed list. (i.e if( residlist[0] == ID_wp_ONE ) retlist[0] = "one.wav"; ) This returned array can then be passed to Execute( char ** ) to play the sounds from disk.

•	NULL if there was not enough memory to build the list.

Examples

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;
char**	filelist;

playlist = Player.CvtNumToSndStr( 123.456, 2, wpPOSITIVE );

if( playlist )
{
filelist = Player.CvtSndStrToFileList( playlist );
delete playlist;

if( filelist )
{
Player.Execute( filelist );
delete filelist;
}
}


Enunciator Sign Options
enum wpSigns

This enumerated type manages how numbers are prefixed with their signs for the CvtNumToSndStr() methods. The following details each of the values of this type and their effects on real and integer values.

 wpUNSIGNED

 wpMINUS

 wpPLUS

 wpNEGATIVE

 wpPOSITIVE


wpUNSIGNED
enum wpSigns { wpUNSIGNED }

•	Integers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123, wpUNSIGNED );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// negative value - the output of this call is...
// NOTE: -123 = 0xFFFFFF85L
//
// "Four Billion Two Hundred Ninety-Four Million
//  Nine Hundred Sixty-Seven Thousand One Hundred
//  Seventy-Three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123, wpUNSIGNED );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

•	Real Numbers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123.3, 1, wpUNSIGNED );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.3, 1, wpUNSIGNED );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}


wpMINUS
enum wpSigns { wpMINUS }

•	Integers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123, wpMINUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// negative value - the output of this call is...
//
// "Minus One Hundred Twenty-Three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123, wpMINUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

•	Real Numbers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123.3, 1, wpMINUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Minus One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.3, 1, wpMINUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}


wpPLUS
enum wpSigns { wpPLUS }

•	Integers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Plus One hundred twenty-three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123, wpPLUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// negative value - the output of this call is...
//
// "Minus One Hundred Twenty-Three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123, wpPLUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

•	Real Numbers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Plus One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123.3, 1, wpPLUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Minus One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.3, 1, wpPLUS );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}


wpNEGATIVE
enum wpSigns { wpNEGATIVE }

•	Integers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123, wpNEGATIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// negative value - the output of this call is...
//
// "Negative One Hundred Twenty-Three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123, wpNEGATIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

•	Real Numbers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123.3, 1, wpNEGATIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Negative Minus One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.3, 1, wpNEGATIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}


wpPOSITIVE
enum wpSigns { wpPOSITIVE }

•	Integers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Positive One hundred twenty-three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123, wpPOSITIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// negative value - the output of this call is...
//
// "Negative One Hundred Twenty-Three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123, wpPOSITIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

•	Real Numbers

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Positive One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( 123.3, 1, wpPOSITIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}

//-------------------------------------------------
// positive value - the output of this call is...
//
// "Negative Minus One hundred twenty-three point three"
//-------------------------------------------------

WavePlayer	Player( _hInstance, MyApp );
unsigned*	playlist;

playlist = Player.CvtNumToSndStr( -123.3, 1, wpPOSITIVE );

if( playlist )
{
Player.Execute( playlist );
delete playlist;
}


Example Application Using WavePlayer

The following listing is from the demo program provided with this distribution of the shareware evaluation version of WavePlayer. It has been cut and pasted without alteration from the demo code.

Loading and playing a .wav file

This example is a menu handler which gets a file from the user and plays it. (See WPDEMO.CPP for complete source)

void wpDemoApp::PlayFile ()
{
TFileOpenDialog	*opendlg;
WavePlayer	Player( _hInstance, this );

// get a file to be opened

opendlg = new TFileOpenDialog(
MainWindow, FileData, 0, "Open Wave File"
);

if( !opendlg ) return;

if( opendlg->Execute() != IDOK )
{
delete opendlg;
return;
}

Player.Execute( FileData.FileName );

delete opendlg;
}

Playing a .WAV Resource

This sample is cut and pasted from a Dialog intialization function and demonstrates playing a single sound resource.

BOOL WaveExample::EvInitDialog (HWND hWndFocus)
{
BOOL result;

result = TDialog::EvInitDialog(hWndFocus);

// INSERT>> Your code here.

WavePlayer	Player( _hInstance, GetApplication() );

Player.Execute( IDW_MESSAGE );

return result;
}

Enunciating numbers

This example is a button cklick handler for a complex dialog which permits the user to input a value and the number of decimal places, to define the means of announcing the sign of the number, to select long or double values and to specify playing the sounds from resource or from disk... in short, this fairly small routine does it all.

void WaveExample::BNClickedSayIt ()
{
// INSERT>> Your code here.

wpSigns	signs;
int	precision;
double	dvalue;
long	lvalue;
char	numstr[15];
unsigned	*resource_list;
char	**file_list;
WavePlayer	Player( _hInstance, GetApplication() );

// what signing method are we to use?

if(      UnsignedRBtn->GetCheck()  == BF_CHECKED )
signs = wpUNSIGNED;
else if( MinusRBtn->GetCheck()     == BF_CHECKED )
signs = wpMINUS;
else if( NegativeRBtn->GetCheck()  == BF_CHECKED )
signs = wpNEGATIVE;
else if( PLusMinusRBtn->GetCheck() == BF_CHECKED )
signs = wpPLUS;
else
signs = wpPOSITIVE;

// input a precision

NumDecimals->GetLine( numstr, sizeof(numstr), -1 );

if( *numstr ) precision = *numstr - '0';
else          precision = 0;

// input the value to be stated

EnunciateValue->GetLine( numstr, sizeof(numstr), -1 );

if(      DoublesRBtn->GetCheck()  == BF_CHECKED )
sscanf( numstr, "%lf", &dvalue );
else if( UnsignedRBtn->GetCheck() == BF_CHECKED )
sscanf( numstr, "%lu", &lvalue );
else
sscanf( numstr, "%ld", &lvalue );

// convert the number to a wave string

if( DoublesRBtn->GetCheck() == BF_CHECKED )
resource_list = Player.CvtNumToSndStr(
dvalue, precision, signs
);
else
resource_list = Player.CvtNumToSndStr( lvalue, signs );

// if playing from disk, convert resource list to
// file list and play it

if( PlayFromDiskRBtn->GetCheck() == BF_CHECKED )
{
file_list = Player.CvtSndStrToFileList( resource_list );
delete resource_list;

Player.Execute( file_list );
delete file_list;
}

// otherwise, play the string from the resources

else
{
Player.Execute( resource_list );
delete resource_list;
}
}


Example WavePlayer Class Source

The following code fragment is cut and pasted from the source code for the shareware evaluation version of WavePlayer and is intended to demonstrate the coding style and commenting used in the source.

//----------------------------------------------------------------------------
// unsigned *WavePlayer::CvtNumToSndStr
// (
//	double val, int precision, wpSigns sign = wpUNSIGNED
// );
//
// This method converts a real value into a list of resource ID numbers
// required to speak the number. That list can then be passed into the Execute
// method to enunciate the value. Note that if the value of signed is
// wpUNSIGNED (the default) the value is treated as an unsigned long and the
// full capacity of that value is available. It is the caller's responsibility
// to delete the pointer that is returned by this method!
//
// The method rounds the value to the nearest decimal specified by precision.
//
// arguments:
//
//	val	the floating point number to be converted
//	precision	number of decimal places to read to
//	sign	the type of signed enunciation to use
//	(default = wpUNSIGNED)
//
// returns:	pointer to a list of resource IDs for Execute()
//	NULL if there is not enough free memory for the list
//
//----------------------------------------------------------------------------

unsigned *WavePlayer::CvtNumToSndStr(
double val, int precision, wpSigns sign
) {
int	i;
int	index;
double	round_val = 0.5;
unsigned	*ptr;
unsigned long	uval = 0;
unsigned	str[100];

// correct the sign if required

if( sign == wpUNSIGNED && val < 0.0 )
val = -val;

// determine the value needed to round the number properly

for( i = 0; i < precision; i++ )
round_val /= 10.0;

// round the number according to the precision

if( val < 0.0 ) val -= round_val;
else            val += round_val;

// convert the integer portion of the number to a sound string

uval |= (unsigned long)((long)val);

ptr = CvtNumToSndStr( (long)uval, sign );

// if we aren't enunciating decimals, we're done

if( precision <= 0 )
return ptr;

// copy the returned string into our build string

for( index = 0; ptr[index]; index++ )
str[index] = ptr[index];

str[index++] = ID_wp_POINT;

delete ptr;

// all decimals are unsigned

if( val < 0.0 )
val = -val;

// eliminate the integer portion of the value without using math.h

uval = (unsigned long)val;
val -= (double)uval;

// convert decimals to words

for( i = 0, val *= 10.0; i < precision; i++, val *= 10.0 )
{
uval  = (unsigned long)val;
uval %= 10;
str[index++] = ID_wp_ZERO + (unsigned)uval;
}

// terminate the string

str[index++] = 0;

// copy the string to a dynamic buffer

ptr = new unsigned[index];

for( i = 0; i < index; i++ )
ptr[i] = str[i];

return ptr;
}


Getting Help

Are you feeling lost, confused or just plain unloved? I welcome your suggestions, comments and questions. Just try to be polite <g> If you need to contact me, you have three choices...

1 	Snail Mail: If you're in no particular hurry, write to

K. Scott Piel
c/o Lighthouse Engineering
5055 Pleasant Valley Rd.
Virginia Beach, Virginia 23464-6005
(USA)

2 	By phone: Can't get enough of my voice in the demo? Feel free to call Monday - Friday 9am to 5pm Eastern time.

(804) 467-4167

3 	Via CompuServe: The best way to reach me, any time of day. I spend way too much time bopping about CIS <G>. The best areas to find me in are GO BCPPWIN and GO WINSHARE. Otherwise, you are always welcome to send E-Mail. I check in on CIS at least once a day, sometimes more. If you don't hear back within 24 hours, you can assume I'm either on vacation or dead. CIS makes the world go round <vbg>

CIS ID 74151,1035


Index
Index Of Topics

I loath that his index is such a mess. However, there is a bug in the help authoring tool I use, and until it is fixed, I have to live with these redundant index entries. My apologies to you and I promise to fix it the moment they do!<Scott>

#

.WAV File Format

.WAV Recourses

.WAV Resource Type

~WavePlayer

A

Adding Your Own Wave Resources

Address

C

Changing WavePlayer's Voice

Class Construction/Destruction

Class definition

Class Definition

Class Reference

Compile Time Options

CompuServe ID

Constructor

Constructor

Contents

Contents

Convert Integer To Sound String

Convert Integer To Sound String

Convert Real To Sound String

Convert Real To Sound String

Convert Sound String To File List

Convert Sound String To File List

Converting Numbers To Words

CvtNumToSndStr( double, int, wpSigns )

CvtNumToSndStr( long, wpSigns )

CvtNumToSndStr() // wpSigns

CvtSndStrToFileList( unsigned * )

D

Destructor

Destructor

E

enum wpErrors

enum wpSigns

enum wpSigns

enum wpSigns

enum wpSigns

enum wpSigns

Enunciating Numbers

Enunciator Sign Options

Enunciator Sign Options

Enunciator Sign Options

Enunciator Sign Options

Enunciator Sign Options

Enunciator Sign Options

Error Reporting

Error Reporting

Example Application Using WavePlayer

Example Code

Example Program

Example WavePlayer Class Source

Examples

Examples

Execute Multiple Files

Execute Multiple Files

Execute Multiple Resources

Execute Multiple Resources

Execute Single File

Execute Single Resource

Execute Single Source

Execute( char ** )

Execute( unsgined * )

Execute( unsigned )

G

Getting Help

Getting Help

Glossary

Glossary

H

Help Header

Help Header

I

ID_wp_???????

Include Files

Include Files

Index

Index

L

LastError()

Licensing Agreement

Licensing Agreement

O

Order Form

Overview

P

Phone Number

Playing a .WAV File

Playing a .WAV Resource

Playing Wave Sounds

R

Registering WavePlayer

Registrering WavePlayer

Resource Constants

Resource Header

Resource Header

Resource Include

Resource Include

S

Sample Application Code

Sample Source

Sample WavePlayer Class Source

Shareware

Shareware

Shareware

U

Using WavePlayer Resources

W

Wave Sound Files

Wave Sound Files

WavePlayer Class Library

WavePlayer Class Library

WavePlayer Class Reference

WavePlayer Order Form

WavePlayer Resource Include

WavePlayer( HINSTANCE, TApplication *)

WavePlayer()

WavePlayer::~WavePlayer

WavePlayer::CvtNumToSndStr( double, int, wpSigns )

WavePlayer::CvtNumToSndStr( long, wpSigns )

WavePlayer::CvtNumToSndStr() // wpSigns

WavePlayer::CvtSndStrToFileList( unsigned * )

WavePlayer::Execute( char ** )

WavePlayer::Execute( unsigned * )

WavePlayer::Execute(unsigned)

WavePlayer::LastError()

WavePlayer::WavePlayer( HINSTANCE, TApplication *)

WavePlayer::WavePlayer()

WAVPLAYR.HH

WAVPLAYR.HPP

WAVPLAYR.LIB

WAVPLAYR.RC

WAVPLAYR.RH

wpDemo Application

wpDemo Example Application

wpErrors

wpErrors

wpEXCLUDE_FILES

wpFIRSTID

wpLASTID

wpLOADFAILED

wpLOCKFAILED

wpMINUS

wpMINUS

wpMINUS

wpNEGATIVE

wpNEGATIVE

wpNEGATIVE

wpNOERROR

wpNOTFOUND

wpPLAYFAILED

wpPLUS

wpPLUS

wpPLUS

wpPOSITIVE

wpPOSITIVE

wpPOSITIVE

wpSigns

wpSigns

wpSigns

wpSigns

wpSigns

wpSigns

wpUNSIGNED

wpUNSIGNED

wpUSES_OWL

wpWAVEDATA


Glossary

B

Borland C++

C

CompuServe

L

Lighthouse Engineering

M

MFC

Microsoft

O

OWL 2

OWL

R

Register

Registered Version

S

Shareware Evaluation Version

Shareware

W

WavePlayer

Windows


Borland C++

Borland C++ is a trademark of Borland International, Inc.


CompuServe

CompuServe is a registered trademark of CompuServe, Inc.


Lighthouse Engineering

Lighthouse Engineering is a DBA owned and operated by K. Scott Piel


MFC

MFC (Microsoft Foundation Class) is a Trademark of Microsoft Corporation.


Microsoft

Microsoft is a registered trademark of Microsoft Corporation


OWL 2

OWL (Object Windows Library) is a trademark of Borland International, Inc.


OWL

OWL (Object Windows Library) is a trademark of Borland International, Inc.


Register

Registering shareware is equivelent to buying a program from a retail vendor. If you intend to continue the use of the shareware product you are using, you must pay for it.


Registered Version

The registered version of a shareware program is the complete commercial version of the product you are trying out. You receive this version after paying your registration fee for the shareware evaluation version you are currently trying.


Shareware Evaluation Version

The shareware evaluation version of a product is a copy of the product intended to permit you to try the product and determine whether or not you feel it is a product worth buying for your own use. It may, or may, not be a complete copy of the registered version of the product. The evaluation version is not intended for ongoing use and is generally limited in terms of how long you may use it before you pay for it.


Shareware

Unlike Freeware or public domain software, shareware is not free. Shareware is an alternative to commercial distribution of computer software. It allows you to try a product before you buy it. If you try a shareware product and don't like it, you just delete it from your system and forget about it... nothing is lost. However, if you like it and want to continue to use it, you have to pay for it. Failure to do so is a violation of the license granted by the shareware author and a violation of the trust that has been put in you.


WavePlayer

WavePlayer is a sharware plug and play support class for adding wave data sound support to your Borland C++ 4.0 and OWL 2 programs. WavePlayer is a trademark of Lighthouse Engineering.


Windows

Windows is a trademark of Microsoft Corporation