with VOC_data; with Dos_Io; package VOC_IO is Data_Error: exception; -- impossible data values, premature eof, etc. Not_Yet_Implemented: exception; -- not handled by this package Disk_Full : exception; -- DOS write couldn't write full record Status_Error: exception; -- handle must be open to read/write/get info Name_Error: exception; -- path/file doesn't exist max_sound_length:VOC_data.block_lengths:=VOC_data.block_lengths'last; -- reads of sound blocks bigger than max_sound_length will be split -- automatically. may be modified by user type Handles is limited private; procedure Open(Name : in String; Handle : in out Handles); procedure Read(Handle : in out Handles; block : out VOC_data.blocks); procedure Create(Name : in String; Handle : in out Handles); procedure Write_sound(Handle : in out Handles; block : in VOC_data.blocks); procedure Write_silence(Handle : in out Handles; interval : in duration; sample_rate : in VOC_data.sample_rates:=8000); procedure Write_marker(Handle : in out Handles; mark : in VOC_data.markers); procedure Write_text(Handle : in out Handles; text : in string); procedure Write_repeat(Handle : in out Handles; count : in VOC_data.repeat_counts); procedure Write_end_repeat(Handle : in out Handles); procedure Close(Handle : in out Handles); PRIVATE type blklens is range 0 .. 2**24-1; type existing_voice_infos(voice_to_continue : boolean:=false) is record case voice_to_continue is when false => null; when true => sample_rate : VOC_data.sample_rates; packing : VOC_data.pack_types; remaining_length : blklens; end case; end record; type Handles is record File_Handle : Dos_Io.File_Handle; is_input : boolean:=true; terminated : boolean:=false; voice_info : existing_voice_infos; end record; end VOC_IO;