home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / UTILITIE / VOCSHO.ZIP / VOC_IO.LIB < prev    next >
Text File  |  1991-01-07  |  2KB  |  70 lines

  1. with VOC_data;
  2. with Dos_Io;
  3.  
  4. package VOC_IO is
  5.  
  6.   Data_Error: exception; -- impossible data values, premature eof, etc.
  7.   Not_Yet_Implemented: exception; -- not handled by this package
  8.   Disk_Full : exception; -- DOS write couldn't write full record
  9.   Status_Error: exception; -- handle must be open to read/write/get info
  10.   Name_Error: exception; -- path/file doesn't exist
  11.  
  12.   max_sound_length:VOC_data.block_lengths:=VOC_data.block_lengths'last;
  13.   -- reads of sound blocks bigger than max_sound_length will be split
  14.   --   automatically. may be modified by user
  15.  
  16.   type Handles is limited private;
  17.  
  18.   procedure Open(Name     : in     String;
  19.                  Handle   : in out Handles);
  20.  
  21.   procedure Read(Handle   : in out Handles;
  22.                  block    :    out VOC_data.blocks);
  23.  
  24.   procedure Create(Name   : in     String;
  25.                    Handle : in out Handles);
  26.  
  27.   procedure Write_sound(Handle      : in out Handles;
  28.                         block       : in     VOC_data.blocks);
  29.  
  30.   procedure Write_silence(Handle      : in out Handles;
  31.                           interval    : in     duration;
  32.                           sample_rate : in     VOC_data.sample_rates:=8000);
  33.  
  34.   procedure Write_marker(Handle : in out Handles;
  35.                          mark   : in     VOC_data.markers);
  36.  
  37.   procedure Write_text(Handle : in out Handles;
  38.                        text   : in     string);
  39.  
  40.   procedure Write_repeat(Handle : in out Handles;
  41.                          count  : in     VOC_data.repeat_counts);
  42.  
  43.   procedure Write_end_repeat(Handle : in out Handles);
  44.  
  45.   procedure Close(Handle  : in out Handles);
  46.  
  47. PRIVATE
  48.  
  49.   type blklens is range 0 .. 2**24-1;
  50.  
  51.   type existing_voice_infos(voice_to_continue : boolean:=false) is record
  52.     case voice_to_continue is
  53.     when false =>
  54.       null;
  55.     when true  =>
  56.       sample_rate      : VOC_data.sample_rates;
  57.       packing          : VOC_data.pack_types;
  58.       remaining_length : blklens;
  59.     end case;
  60.   end record;
  61.  
  62.   type Handles is record
  63.     File_Handle       : Dos_Io.File_Handle;
  64.     is_input          : boolean:=true;
  65.     terminated        : boolean:=false;
  66.     voice_info        : existing_voice_infos;
  67.   end record;
  68.  
  69. end VOC_IO;
  70.