wave

Reading *.wav files in Python

和自甴很熟 提交于 2019-11-26 12:49:44
I need to analyze sound written in a .wav file. For that I need to transform this file into set of numbers (arrays, for example). I think I need to use the wave package. However, I do not know how exactly it works. For example I did the following: import wave w = wave.open('/usr/share/sounds/ekiga/voicemail.wav', 'r') for i in range(w.getnframes()): frame = w.readframes(i) print frame As a result of this code I expected to see sound pressure as function of time. In contrast I see a lot of strange, mysterious symbols (which are not hexadecimal numbers). Can anybody, pleas, help me with that?

Pass Blob through ajax to generate a file

↘锁芯ラ 提交于 2019-11-26 07:34:15
问题 I\'m trying to capture audiorecorder (https://github.com/cwilso/AudioRecorder) and send the blob through Ajax a php file, which will receive the blob content and create the file(the wave file in this case). Ajax call: audioRecorder.exportWAV(function(blob) { var url = (window.URL || window.webkitURL).createObjectURL(blob); console.log(url); var filename = <?php echo $filename;?>; $.ajaxFileUpload({ url : \"lib/vocal_render.php\", secureuri :false, dataType : blob.type, data: blob, success: