DINGDANG PLAY

DDPLAY can read standard GB coded Chinese text file and speak in Chinese through the
speakers on your multimedia system. It can also record and playback like a regular sound
program. This program is specially useful to people who is learning the standard mandarin
Chinese. It is also interesting for hobby lovers. By using the full version of the program, you
can play Chinese file using your own voice, or make it to speak in any other Chinese local
dialects that you know.

System Requirement

- MS DOS version 3.1 or later
- IBM compatible PC
- 5 MB free hard disk space
- Sound Blaster compatible card with speakers
- Microphone (optional)

Essentially, DDPLAY is designed for PC with a multimedia system. The large hard disk space
is needed to store the Chinese sound database files. The program takes only about 200K
RAM memory to run. This program is most useful if you also use a Chinese word processor
so that you can create your own Chinese text file. I would suggest to obtain this author's
DingDang Chinese word processor for Windows through internet ftp:

ftp.coast.net: /SimTel/win3/wp/ddwin29.zip
oak.oakland.edu: /SimTel/win3/wp/ddwin29.zip (mirror site)

Standard And Shareware Versions Installation

The standard version includes the following files:

- DDPLAY.EXE*  main program
- DDUTIL.EXE   utility program
- DDTEST.EXE   driver utility program
- DDPLAY.PY    pinyin index file
- DDPLAY.SND   voice database file
- SAMPLE.GB*   sample Chinese GB file
- SAMPLE.SND*  demo sample sound file 
- DEMO.BAT*    batch file
- SWITCH.BAT   switch between male or female voices
- DDPLAY.TXT*  this file in DOS format
- FILE_ID.DIZ* description of zip-files for BBS

Only files marked with asterisk (*) are included in the shareware version. It is suggested that
you copy all the files to "c:\ddplay" directory. To test the program with your sound system,
make sure that your sound card driver is installed correctly and type:
 
  DEMO

You may need to change the default program setting to make it work on your system. Type
program name and return, you will see all available command line options. The default
hardware setting used by the program are as the following:

  IO Address: 544 = 0x220
  IRQ           : 7
  DMA chan.: 1

If you use Sound Blaster Pro card, your default interrupt maybe 5 instead of 7. You can then
play the file by typing:

  DDPLAY -i5 sample.snd

The shareware version only contains demo version of Chinese sound files. The Chinese voice
database file is too large to be included in the shareware version. In the standard version, you
will be able to play "sample.gb" by simply typing "ddplay -g sample.gb". You shall hear the
exactly the same sound as you hear by typing "demo" here.

Record And Play

To record your voice to a file, type:

  DDPLAY -r file.snd

where "file.snd" is any file name you choose. Press any key will stop the recording.

To listen your sound file, type:

  DDPLAY file.snd

where "file.snd" is the sound file name. You can press space bar to pause during playback.

The default sample rate is 10000 Hz. A higher sample rate will provide better sound quality
but takes more hard disk space. To change sample rate to 12000 for example, type:

  DDPLAY -s12000 file.snd

To play a Chinese text file, type:

  DDPLAY -g file.gb

where "file.gb" is a standard GB coded Chinese text file. Each Chinese character is indexed to
get the corresponding sound from the voice database file "ddplay.snd". The Chinese voice
database file is recorded with 10000 Hz sample rate. Each Chinese character takes 3200
bytes of sound byte (8 bits). This means that 4 Chinese characters take 12800 bytes - just
little bit over one second of playing time. Punctuation and English are converted to silent time
of one Chinese character length.

For people who are not very familiar with Chinese, he/she may find the play rate bit too fast to
understand since each character is only represented by 3200 bytes in sound file. This is
mainly to save hard disk space. There is no technical difficulties to make a better sound
quality voice file.

Another thing you will notice is that when playing Chinese file, the characters with multiple
spellings (duo1 yin1 zi4) will not always played correctly. This is because that DDPLAY will
search and use the first spelling of the character found in the pinyin file. If you have DingDang
Chinese word processor, you can see the first spelling of the character by choosing "reveal
pinyin and GB code" menu item (or press F9 key). For example, the character chang2 (long)
and zhang3 (grow) are the same Chinese character with multiple spellings. These two
spellings share one GB code. Chinese sentence "zhang3 da4" (grow up) will be read as
"chang2 da4". This sounds funny, isn't it? The character after it must be checked to find the
correct spelling. This seems to be a difficult problem to deal now. Fortunately, most of the
characters will be spelled correctly.

Record Your Own Voice

You may want to make your own voice database file. If you add or delete a line in the pinyin
file "ddplay.py", you must re-create the voice database file "ddplay.snd". Note that "ddplay.py"
is essentially the same as "ddwin.py" used in DingDang Chinese word processor.

If you have interest, time and energy to make your own voice database file, you can do so by
following the following steps:

1. First you should be familiar with sound files. Record a small sound file like "one, two, ...,
ten" 10 characters in Chinese to file "ten.snd" by typing (and speaking):

  DDPLAY -r ten.snd

You can view your sound file graphically:

  DDUTIL ten.snd

The sound wave is plotted in blue. The smoothed sound wave is plotted in yellow. Now
process the file:

  DDUTIL -p ten.snd

The above command generate a file called "ddutil.snd" in your current directory. You should
see message telling you that "10 characters processed". If you do not have 10 characters,
then you should re-record "ten.snd". Make sure that you read each character clearly, shortly
and leave space between each characters. Play and look your processed sound:

  DDPLAY ddutil.snd
  DDUTIL ddutil.snd

Each character takes 5 VGA screens to display since each screen will display 640 bytes of
data. Once you feel comfortable with DDUTIL program, you are ready to go to the next step.

2. Print all entries in pinyin file:

  DDUTIL -e ddplay.py

The printout contains all pinyin entries in the file. Each line should contain 9 pinyin entries.
Every 10 lines are put into one group with a group number. You should have about 14 groups.

3. Start the driver program:

  DDTEST

Choose "1. Record". Read all pinyin's in group "01" clearly, shortly and pause between each
characters. Press any key when you finished recording. The output is saved to file "temp.snd".
Choose "2. Process" to process the file. The output of processed file is saved to file
"ddutil.snd". You should see "90 characters processed" on screen. Choose "3. Play" to listen
the resulting file "ddutil.snd" and make sure DDUTIL program picked exactly all the characters
correctly. If you do not have exactly 90 characters, don't worry. Simply take a written note and
continue. Choose "4. Save" to save both files. Choose file name like "01.AAA" when you are
prompted. You may use other unique file extensions. The file "temp.snd" will be renamed as
"01.AAA" which contains your original recording, and file "ddutil.snd" will be renamed as
"01.AAB" which is the processed file.

4. Repeat the above process for each group. You can quit the program any time by pressing
ESC key. You can then continue from what you have left from the last time. You should do
each group in order, i.e. do group "01" then group "02" etc. initially so that files on disk is also
listed in sorted order. You can then re-do group "01" later for example, if you think it is not
recorded nicely.

5. Now for all the files that are not processed correctly, you have to fine tuning the processing
procedure. For example, if file "01.AAB" is incorrect (by listening), you need to re-process file
"01.AAA". There are 3 parameters you can change on DDUTIL command line. Parameter
"smooth" is used to smooth the sound wave exponentially (see Time Series book for details).
Decrease the number will usually let the program detects more characters and vice versa.
Parameter "height" is used to pick the wave as sound instead of silence. Increase the number
will usually let the program pick less characters and vice versa. Parameter "lbreak" is used to
determine the minimum length on interval to detects a break between two characters.
Increase the number will usually decrease the number of characters detected by the program.
If some characters can not be picked by the program, then either you have to re-record your
sound file, or I need to modify my algorithm used in DDUTIL which I don't think is needed :-).
Program will use a different algorithm to detect sound and produce output file "ddutil1.snd" if
parameter "-m" specified. This is for testing only.

6. Once you have all the correct "*.AAB" files, you can copy them into file "ddplay.snd". Make
a backup file first and then copy:

  REN ddplay.snd ddplay1.snd
  COPY /B *.AAB ddplay.snd

Note that "/B" option is needed to copy binary files. Now enjoy your voice.

Order Information

If you want to order the latest, complete standard version of the program with a printed
documentation, please send $40 check or money order (can be deposited in US bank) to:

Yijun Ding
12640 Southridge Drive
Little Rock, AR 72212, USA

For e-mail inquiry, you can send internet mail to:

xxye@curie.ualr.edu (Xiu Ye is my wife)
yding@unixs.cis.pitt.edu

Home phone: (501)228-5608

The above price includes one female voice database file by Ms. Xuanhua Zhu, or one male
voice database file by myself. Female voice database file will be sent if not specified. Send
$50 if you want both voice database files to be included.

I like to mention that my another program DingDang Chinese word processor for Windows,
which has many copies sold, is also $40 to the same address.

All prices include first class air-mail shipping to anywhere on earth!
