Kaynağa Gözat

ready to attempt sample rate stuff

dds
Matt Bradshaw 6 yıl önce
ebeveyn
işleme
f7b8ce783d
2 değiştirilmiş dosya ile 10 ekleme ve 2 silme
  1. +8
    -1
      extras/wav2sketch/wav2sketch.html
  2. +2
    -1
      extras/wav2sketch/wav2sketch.js

+ 8
- 1
extras/wav2sketch/wav2sketch.html Dosyayı Görüntüle

@@ -6,7 +6,14 @@
<h1>Teensy Audio Wav2Sketch Utility</h1>
<p>Upload an audio file to convert it into Teensy audio format.</p>
<form>
<input id="audioFileChooser" name="audioFileChooser" type="file" accept="audio/*" multiple>
<label>Sample rate</label>
<select>
<option>Auto</option>
<option>44100</option>
<option>22050</option>
<option>11025</option>
</select><br/><br/>
<input id="audioFileChooser" name="audioFileChooser" type="file" accept="audio/wav" multiple>
<div id="outputFileHolder"></div>
</form>
<script type="text/javascript" src="wav2sketch.js"></script>

+ 2
- 1
extras/wav2sketch/wav2sketch.js Dosyayı Görüntüle

@@ -19,8 +19,9 @@ function readFile() {
}

function processFile(file, fileName) {
var context = new OfflineAudioContext(1,10*44100,44100);
var context = new OfflineAudioContext(1,100*44100,44100); // 100 seconds for now
context.decodeAudioData(file, function(buffer) {
console.log(buffer.sampleRate);
var monoData = [];
if(buffer.numberOfChannels == 1) {
monoData = buffer.getChannelData(0);

Yükleniyor…
İptal
Kaydet