text
stringlengths
0
234
Header : String);
procedure Write_Wavefile
(Wav_File_Name : String;
Test_Bits : Wav_Bit_Depth);
procedure Read_Wavefile
(Wav_File_Name : String;
PCM_DUT : out PCM_Buffer);
function Image (B : Wav_Bit_Depth) return String renames
Audio.RIFF.Wav.Formats.Report.Image;
----------------------
-- Display_PCM_Vals --
----------------------
procedure Display_PCM_Vals (PCM_Vals : PCM_Buffer;
Header : String)
is
Display_Integer_Value : constant Boolean := False;
begin
Put_Line (Header);
for Sample_Count in PCM_Vals'Range loop
declare
PCM_Integer : array (1 .. 2) of Integer_64
with
Address => PCM_Vals (Sample_Count)'Address,
Size => 128;
begin
Put (" Val: ");
PCM_Sample_Text_IO.Put (Item => PCM_Vals (Sample_Count),
Fore => 5,
Aft => 60,
Exp => 5);
if Display_Integer_Value then
Put (" - ");
for I in PCM_Integer'Range loop
Fixed_64_PCM_As_Integer_Text_IO.Put
(PCM_Integer (I), Base => 2, Width => 68);
end loop;
end if;
New_Line;
Function Definition: procedure Display_Info
Function Body: (WF : Wavefile;
Header : String)
is
Separator : constant String
:= "===========================================================";
begin
Put_Line (Separator);
Put_Line (Header);
Display_Info (WF);
Put_Line (Separator);
end Display_Info;
--------------------
-- Write_Wavefile --
--------------------
procedure Write_Wavefile
(Wav_File_Name : String;
Test_Bits : Wav_Bit_Depth)
is
WF_Out : Wavefile;
Wave_Format : Wave_Format_Extensible;
begin
Wave_Format := Init (Bit_Depth => Test_Bits,
Sample_Rate => Sample_Rate_44100,
Number_Of_Channels => 2,
Use_Float => True);
WF_Out.Set_Format_Of_Wavefile (Wave_Format);
WF_Out.Create (Out_File, Wav_File_Name);
Write_PCM_Vals (WF_Out, PCM_Ref);
WF_Out.Close;
end Write_Wavefile;
-------------------
-- Read_Wavefile --
-------------------
procedure Read_Wavefile
(Wav_File_Name : String;
PCM_DUT : out PCM_Buffer)
is
WF_In : Wavefile;
-- Wave_Format : Wave_Format_Extensible;
EOF : Boolean;
Samples : Integer := 0;
begin
WF_In.Open (In_File, Wav_File_Name);
-- Wave_Format := WF_In.Format_Of_Wavefile;
if Verbose then
Display_Info (WF_In, "Input File:");