package VOC_data is type sound_bytes is range 0 .. 255; for sound_bytes'size use 8; max_block_length:constant:=20000; subtype block_lengths is integer range 0 .. max_block_length; subtype sound_indices is integer range 1 .. max_block_length; type sounds is array(sound_indices range <>) of sound_bytes; type block_types is (terminator,voice_data,voice_continuation, silence,marker,text,start_repeat,end_repeat); for block_types use (terminator=>0,voice_data=>1,voice_continuation=>2, silence=>3,marker=>4,text=>5,start_repeat=>6, end_repeat=>7); for block_types'size use 8; subtype sample_rates is natural range 3906 .. integer'last; type pack_types is (unpacked,halved,thirds,quartered); for pack_types use (unpacked=>0,halved=>1,thirds=>2,quartered=>3); type markers is range 1 .. 16#FFFE#; type repeat_counts is range 1 .. 16#FFFF#; type blocks(block_type : block_types:=terminator) is record block_length : block_lengths:=1; case block_type is when terminator => null; when voice_data | voice_continuation => sample_rate : sample_rates; packing : pack_types; data : sounds(1 .. max_block_length); when silence => silence_interval : duration; when marker => mark : markers; when text => text_string : string(1 .. max_block_length); when start_repeat => count : repeat_counts; when end_repeat => null; end case; end record; end VOC_data;