<commit_before>package com.axis.audioclient {

  import flash.events.Event;
  import flash.events.ProgressEvent;
  import flash.events.ErrorEvent;
  import flash.events.SampleDataEvent;
  import flash.events.StatusEvent;
  import flash.events.SecurityErrorEvent;
  import flash.events.IOErrorEvent;
  import flash.net.Socket;
  import flash.media.Microphone;
  import flash.media.SoundCodec;
  import flash.utils.ByteArray;

  import com.axis.codec.g711;
  import com.axis.http.url;
  import com.axis.http.auth;
  import com.axis.http.request;

  public class AxisTransmit {
    private var urlParsed:Object = {};
    private var conn:Socket = new Socket();

    private var authState:String = 'none';
    private var authOpts:Object = {};

    public function AxisTransmit() {
    }

    private function onMicStatus(event:StatusEvent):void {
      if (conn.connected) {
        authState = 'none';
        conn.close();
      }

      if ('Microphone.Muted' === event.code) {
        trace('AxisTransmit: Denied access to microphone');
        return;
      }

      if (urlParsed.host && urlParsed.port) {
        conn.connect(urlParsed.host, urlParsed.port);
      }
    }

    public function start(iurl:String):void {
      if (conn.connected) {
        trace('already connected');
        return;
      }

      var mic:Microphone = Microphone.getMicrophone();
      mic.rate = 16;
      mic.setSilenceLevel(0, -1);
      mic.addEventListener(StatusEvent.STATUS, onMicStatus);
      mic.addEventListener(SampleDataEvent.SAMPLE_DATA, onMicSampleData);

      this.urlParsed = url.parse(iurl);

      conn = new Socket();<commit_msg>Save url<commit_after>package com.axis.audioclient {

  import flash.events.Event;
  import flash.events.ProgressEvent;
  import flash.events.ErrorEvent;
  import flash.events.SampleDataEvent;
  import flash.events.StatusEvent;
  import flash.events.SecurityErrorEvent;
  import flash.events.IOErrorEvent;
  import flash.net.Socket;
  import flash.media.Microphone;
  import flash.media.SoundCodec;
  import flash.utils.ByteArray;

  import com.axis.codec.g711;
  import com.axis.http.url;
  import com.axis.http.auth;
  import com.axis.http.request;

  public class AxisTransmit {
    private var urlParsed:Object = {};
    private var conn:Socket = new Socket();

    private var authState:String = 'none';
    private var authOpts:Object = {};

    private var savedUrl:String = null;

    public function AxisTransmit() {
    }

    private function onMicStatus(event:StatusEvent):void {
      if (conn.connected) {
        authState = 'none';
        conn.close();
      }

      if ('Microphone.Muted' === event.code) {
        trace('AxisTransmit: Denied access to microphone');
        return;
      }

      if (urlParsed.host && urlParsed.port) {
        conn.connect(urlParsed.host, urlParsed.port);
      }
    }

    public function start(iurl:String = null):void {
      if (conn.connected) {
        trace('already connected');
        return;
      }

      var currentUrl:String = (iurl) ? iurl : savedUrl;

      if (!currentUrl) {
        trace("no url provided");
        return;
      }

      this.savedUrl = currentUrl;

      var mic:Microphone = Microphone.getMicrophone();
      mic.rate = 16;
      mic.setSilenceLevel(0, -1);
      mic.addEventListener(StatusEvent.STATUS, onMicStatus);
      mic.addEventListener(SampleDataEvent.SAMPLE_DATA, onMicSampleData);

      this.urlParsed = url.parse(currentUrl);

      conn = new Socket();
{'fraction_non_alphanumeric': 0.11282490716938018, 'fraction_numerical': 0.003998857469294488, 'mean_word_length': 2.921612541993281, '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': '5145699', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1050, 'n_words': 216}