<commit_before>with Ada.Numerics.Float_Random;            use Ada.Numerics.Float_Random;

with Audio.Wavefiles;                      use Audio.Wavefiles;
with Audio.Wavefiles.Data_Types;           use Audio.Wavefiles.Data_Types;
with Audio.Wavefiles.Generic_Float_PCM_IO;
with Audio.RIFF.Wav.Formats;               use Audio.RIFF.Wav.Formats;

procedure Write_Random_Noise_Wavefile is
   Wav_File_Name    : constant String          := "2ch_long_noise.wav";
   Sample_Rate_Enum : constant Wav_Sample_Rate := Sample_Rate_44100;
   Num_Channels     : constant Positive        := 2;

   WF               : Wavefile;
begin
   Set_Format_Of_Wavefile (WF,
                           Init (Bit_Depth          => Bit_Depth_16,
                                 Sample_Rate        => Sample_Rate_Enum,
                                 Number_Of_Channels => Num_Channels,
                                 Use_Float          => False));

   Create (WF, Out_File, Wav_File_Name);

   if Is_Opened (WF) then

      Write_Stereo_Random_Noise : declare
         package PCM_IO is new Audio.Wavefiles.Generic_Float_PCM_IO
           (PCM_Sample    => Wav_Float_32,
            PCM_MC_Sample => Wav_Buffer_Float_32);
         use PCM_IO;

         Sample_Rate      : constant Float :=
                              Float (To_Positive (Sample_Rate_Enum));
         Duration_In_Secs : constant := 240.0;
         Last_Sample      : constant Positive
           := Positive (Sample_Rate * Duration_In_Secs);<commit_msg>Renaming "Is_Opened" to "Is_Open"<commit_after>with Ada.Numerics.Float_Random;            use Ada.Numerics.Float_Random;

with Audio.Wavefiles;                      use Audio.Wavefiles;
with Audio.Wavefiles.Data_Types;           use Audio.Wavefiles.Data_Types;
with Audio.Wavefiles.Generic_Float_PCM_IO;
with Audio.RIFF.Wav.Formats;               use Audio.RIFF.Wav.Formats;

procedure Write_Random_Noise_Wavefile is
   Wav_File_Name    : constant String          := "2ch_long_noise.wav";
   Sample_Rate_Enum : constant Wav_Sample_Rate := Sample_Rate_44100;
   Num_Channels     : constant Positive        := 2;

   WF               : Wavefile;
begin
   Set_Format_Of_Wavefile (WF,
                           Init (Bit_Depth          => Bit_Depth_16,
                                 Sample_Rate        => Sample_Rate_Enum,
                                 Number_Of_Channels => Num_Channels,
                                 Use_Float          => False));

   Create (WF, Out_File, Wav_File_Name);

   if Is_Open (WF) then

      Write_Stereo_Random_Noise : declare
         package PCM_IO is new Audio.Wavefiles.Generic_Float_PCM_IO
           (PCM_Sample    => Wav_Float_32,
            PCM_MC_Sample => Wav_Buffer_Float_32);
         use PCM_IO;

         Sample_Rate      : constant Float :=
                              Float (To_Positive (Sample_Rate_Enum));
         Duration_In_Secs : constant := 240.0;
         Last_Sample      : constant Positive
           := Positive (Sample_Rate * Duration_In_Secs);
{'fraction_non_alphanumeric': 0.0697211155378486, 'fraction_numerical': 0.011288180610889775, 'mean_word_length': 1.8586337760910816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '415752', 'n_tokens_mistral': 948, 'n_tokens_neox': 866, 'n_words': 168}