<commit_before><!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Record/Encode Audio</title>

  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> 
  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> 

  <style type='text/css'>
    body{ padding: 15px; margin: 15px;}
    
  </style>

</head>
<body>

  <h1>Record/Encode Audio on Browser using the WebAudio API and "ported" libraries.</h1>
 Here <a href="/audio/19 23 C. Chopek and New Retro Strings_verB.mp3"> mp3file</a> here

  <h2>Platforms and Browsers</h2>
  <ul>
    <li>Chrome 32+</li>
  </ul>

  <h2>Codecs</h2>
  <ul>
    <li> MP3: 22.050Hz && 128Kbps using the ported liblame</li>
    <li> Ogg-Vorbis: @TODO</li>
    <li> Spx: @TODO</li>
    <li> Flac: @TODO</li>

  </ul>


  <button  class="btn btn-default" onclick="startRecording(this);">Record</button>
  <button   class="btn btn-default"  onclick="stopRecording(this);" disabled>Stop</button>
  
  <h2>Recordings</h2>
  <ul id="recordingslist"></ul>
  
  <h2>Log</h2>
  <pre id="log"></pre>

  <script>

  function logHTML(e, data) {
    log.innerHTML += "\n" + e + " " + (data || '');
  }


  var audioContext;
  var audioRecorder;


  var _realAudioInput;


  function handlerStartUserMedia(stream) {

    console.log('handlerStartUserMedia');
    console.log('sampleRate:'+ audioContext.sampleRate);

    // MEDIA STREAM SOURCE -> ZERO GAIN >
    _realAudioInput = audioContext.createMediaStreamSource(stream);

    audioRecorder = new Recorder(_realAudioInput);


  }

  function handlerErrorUserMedia(e) {
      logHTML('No live audio input: ' + e);
  }

claudia = new Audio('/audio/19 23 C. Chopek and New Retro Strings_verB.mp3')

  function startRecording(button) {

    if(!audioRecorder)
      return;
    
    claudia.play()
 
    audioRecorder && audioRecorder.record();

    //GUI
    button.disabled = true;
    button.nextElementSibling.disabled = false;

    logHTML('Recording...');


  }

  function stopRecording(button) {

    if(!audioRecorder)
      return;

	claudia.pause()
	
    audioRecorder && audioRecorder.stop();

    //GUI
    button.disabled = true;
    button.previousElementSibling.disabled = false;

    logHTML('Stopped recording.');
 

  }


  window.onload = function init() {

    //try {

      // webkit shim.
      window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;

      navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);

      window.URL = window.URL || window.webkitURL;
      
      audioContext = new AudioContext;

      logHTML('Audio context set up.');
      logHTML('navigator.getUserMedia ' + (navigator.getUserMedia ? 'available.' : 'not present!'));

    //} catch (e) {

    //  alert('No web audio support in this browser!');

    //}

    
    navigator.getUserMedia({vide:false, audio: true}, handlerStartUserMedia, handlerErrorUserMedia);

  };

  </script>

   <script type="text/javascript" src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>		
	<script type="text/javascript" src='{{ compiled('spin.min.js',		  
		'recorder.js') }}'>
	</script>		
   <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>


</body>
</html><commit_msg>Glitch studio resets audio file now.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">	
	<head>	  <meta charset="utf-8">
	
	<title>Glitch Recording Studio</title>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  

  <meta name="viewport" content="width=device-width, initial-scale=1">		
  <link rel="shortcut icon" type="image/png" href="/static/img/favicon.png" />

  <link rel="image_src" type="image/png" href="/static/img/icon.png" />

  <link href='http://fonts.googleapis.com/css?family=Signika:300' rel='stylesheet' type='text/css'>

  <link href='{{ compiled('style.scss') }}' rel='stylesheet' type='text/css' />

  <link href='{{ compiled('style-extra.scss') }}' rel='stylesheet' type='text/css' />
  
  <link href='{{ compiled(
  	'bar-ui.css',
	'sprites.css',
	'flashblock.css',
	'360player.css',
	'360player-visualization.css'
  ) }}' rel='stylesheet' type='text/css' />

  <link href='{{ compiled('style-responsive-players.scss') }}' rel='stylesheet' type='text/css' />
  

  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> 
  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> 


</head>
<body>
	<header id="header" role="banner">
  	{% block user %}		
  		<div class="user">				
  			<p>Hello {{ user_name }}!</p>		
  		</div>		
  	{% end %}		
  		<a href="/" style="display:block;">		
		<div id="title-admin">				
		</div></a>	
  	</header>	
  	<br style="clear:both"/>  
  	<!--Pattern HTML-->	
  	<div class="secondary">
		 <section id="pattern" class="pattern">  	
			<ul class="grid">
				<li class="wide">		
					<div class="secondary-two">	
  <h2>Glitch Recording Studio</h2>
	<p>Due to the magic of modern technology......</p>
  <div class="errors">(This will only work in Chrome (version 3.2+) and recent versions of Firefox)</div>
  <button  class="btn btn-default" onclick="startRecording(this);">Record</button>
  <button   class="btn btn-default"  onclick="stopRecording(this);" disabled>Stop</button>
  
  <h2>Recordings</h2>
  <ul id="recordingslist"></ul>
  
  <h2>Log</h2>
  <pre id="log"></pre>
  </div>		
					<div style="clear:both;"></div>	
				</li>			
				{% block right-nav %}			
				<li>				
					<nav role="navigation">					
						<div style="text-align: center"><ul>
							<li><a href="/create_account"><img src="static/img/sign-up.png" border="0" width="78" height="23" alt=""></a></li>
							<li><a href="/login"><img src="static/img/login-link.png" border="0" width="62" height="25" alt=""></a></li>
							<li><a href="/logout"><img src="static/img/logout-link.png" border="0" width="47" height="39" alt=""></a></li>
							<li><a href="/choice_chunks"><img src="static/img/segment-selection-link.png" border="0" width="82" height="38" alt=""></a></li>
							<li><a href="/submit"><img src="static/img/submit-link.png" border="0" width="137" height="26" alt=""></a></li>
							<li><a href="/oracle"><img src="static/img/magic-ball-link.png" border="0" width="114" height="96" alt=""></a></li>
							<li><a href="/credits"><img src="static/img/credits-link.png" border="0" width="85" height="21" alt=""></a></li>
						</ul></div>				
					</nav>			
				</li>					
			</ul>	
		</section>		
		{% end %}	
	</div>	
	
  <audio id='BackgroundTrack' src='/audio/19 23 C. Chopek and New Retro Strings_verB.mp3'/>
  <script>

  function logHTML(e, data) {
    log.innerHTML += "\n" + e + " " + (data || '');
  }


  var audioContext;
  var audioRecorder;


  var _realAudioInput;


  function handlerStartUserMedia(stream) {

    console.log('handlerStartUserMedia');
    console.log('sampleRate:'+ audioContext.sampleRate);

    // MEDIA STREAM SOURCE -> ZERO GAIN >
    _realAudioInput = audioContext.createMediaStreamSource(stream);

    audioRecorder = new Recorder(_realAudioInput);


  }

  function handlerErrorUserMedia(e) {
      logHTML('No live audio input: ' + e);
  }

claudia = new Audio('/audio/19 23 C. Chopek and New Retro Strings_verB.mp3')

  function startRecording(button) {

    if(!audioRecorder)
      return;
    
   	var thissound=document.getElementById('BackgroundTrack');
    	thissound.load();
    	thissound.play();
 
    audioRecorder && audioRecorder.record();

    //GUI
    button.disabled = true;
    button.nextElementSibling.disabled = false;

    logHTML('Recording...');


  }

  function stopRecording(button) {

    if(!audioRecorder)
      return;

	   	var thissound=document.getElementById('BackgroundTrack');
    	thissound.pause();
   		thissound.currentTime = 0;
	
    audioRecorder && audioRecorder.stop();

    //GUI
    button.disabled = true;
    button.previousElementSibling.disabled = false;

    logHTML('Stopped recording.');
 

  }


  window.onload = function init() {

    //try {

      // webkit shim.
      window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext;

      navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);

      window.URL = window.URL || window.webkitURL;
      
      audioContext = new AudioContext;

      logHTML('Audio context set up.');
      logHTML('navigator.getUserMedia ' + (navigator.getUserMedia ? 'available.' : 'not present!'));

    //} catch (e) {

    //  alert('No web audio support in this browser!');

    //}

    
    navigator.getUserMedia({vide:false, audio: true}, handlerStartUserMedia, handlerErrorUserMedia);

  };

  </script>

   <script type="text/javascript" src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>		
	<script type="text/javascript" src='{{ compiled('spin.min.js',		  
		'recorder.js') }}'>
	</script>		
   <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

	<div class="container">			
		<footer role="contentinfo">
			<div>				
				<!-- Amended February 28 -->
				<nav id="menu">
					<ul class="footer_menu">
					<li class="footerlist"><a href="/">Home</a> </li>
					<li class="footerlist"><font size="-1">&nbsp;&copy; 2014 Future Fossil</font></li>
					<li class="footerlist"><a href="mailto:<EMAIL>">Contact</a>	</li>
					<li class="footerlist"><a href="http://chrisbutler1.bandcamp.com" target="_newbrowser">Bandcamp</a>	</li>
					<li class="footerlist"><a href="http://www.futurefossilmusic.com/" title="Home for all things <NAME>">Future Fossil Music</a></li>
					
					</ul>
				</nav>			
			</div>		
		</footer>	
	</div>				
		
	
	<script type="text/javascript" >			
	$(".title").click(function() {
		window.location = $(this).find("a").attr("href"); 		  
		return false;		
		});		
	</script>		
		<script type="text/javascript" src='{{ compiled('socket.io.js') }}'></script>
</div>
	</body>
		</html>
{'fraction_non_alphanumeric': 0.18471522665633475, 'fraction_numerical': 0.01336691204959318, 'mean_word_length': 3.382427843803056, 'pattern_counts': {'":': 0, '<': 212, '<?xml version=': 0, '>': 216, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3676147', 'n_tokens_mistral': 3963, 'n_tokens_neox': 3532, 'n_words': 644}