<commit_before>require 'java'

class Diarize

  class AudioPlayer

    def play(file, start=0.0, duration=10.0)
      java_file = java.io.File.new(file.path)
      stream = javax.sound.sampled.AudioSystem.getAudioInputStream(java_file)
      clip = javax.sound.sampled.AudioSystem.clip
      clip.open(stream)
      clip.setMicrosecondPosition(duration * 1000000)
      clip.start
      begin
        sleep(duration)
      rescue Exception
        $stderr.puts 'Stopping playback'
      end
      clip.stop
      clip.close
    end

  end

end<commit_msg>Oops - should be start rather than duration<commit_after>require 'java'

class Diarize

  class AudioPlayer

    def play(file, start=0.0, duration=10.0)
      java_file = java.io.File.new(file.path)
      stream = javax.sound.sampled.AudioSystem.getAudioInputStream(java_file)
      clip = javax.sound.sampled.AudioSystem.clip
      clip.open(stream)
      clip.setMicrosecondPosition(start * 1000000)
      clip.start
      begin
        sleep(duration)
      rescue Exception
        $stderr.puts 'Stopping playback'
      end
      clip.stop
      clip.close
      stream.close
    end

  end

end
{'fraction_non_alphanumeric': 0.0847750865051903, 'fraction_numerical': 0.020761245674740483, 'mean_word_length': 2.53822629969419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3367094', 'n_tokens_mistral': 380, 'n_tokens_neox': 355, 'n_words': 72}