audio-analysis

Meaning of the function numpy.fft.fftfreq

安稳与你 提交于 2021-02-05 05:52:08
问题 Some days ago I came across this answer about the usage of the FFT In the answer there's a piece of code like this: w = np.fft.fft(data) freqs = np.fft.fftfreq(len(w)) I read about the function fftfreq in the numpy documentation (here) and i found that it returns an array with the following content: f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n) if n is even f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n) if n is odd In my case, the d var is equal to 1 and n is an even number. So my

run aubiopitch continuously on a file descriptor

我们两清 提交于 2020-01-16 01:13:09
问题 I'd like to use aubiopitch to continuously output the frequency of a signal coming from an input source. Since aubiopitch likes to have its input be a file, not a stream, I tried using process substitution: $ aubiopitch -i <(sox -q -d -t wav -) I'd expect this to output the frequency of the signal being read off of my default audio input device. Instead, I got this: ./sox WARN wav: Length in output .wav header will be wrong since can't seek to fix it AUBIO ERROR: source_apple_audio: Failed

Sound analysis without getUserMedia

混江龙づ霸主 提交于 2019-12-24 06:24:18
问题 I am trying to analyse the audio output from the browser, but I don't want the getUserMedia prompt to appear (which asks for microphone permission). The sound sources are SpeechSynthesis and an Mp3 file. Here's my code: return navigator.mediaDevices.getUserMedia({ audio: true }) .then(stream => new Promise(resolve => { const track = stream.getAudioTracks()[0]; this.mediaStream_.addTrack(track); this._source = this.audioContext.createMediaStreamSource(this.mediaStream_); this._source.connect

Using Python to measure audio “loudness”

旧城冷巷雨未停 提交于 2019-12-08 08:02:02
问题 I'm looking to calculate the loudness of a piece of audio using Python — probably by extracting the peak volume of a piece of audio, or possibly using a more accurate measure (RMS?). What's the best way to do this? I've had a look at pyaudio, but that didn't seem to do what I wanted. What looked good was ruby-audio, as this seemingly has sound.abs.max built into it. The input audio will be taken from various local MP3 files that are around 30s in duration. 回答1: I think that the RMS would be

Matlab: Finding dominant frequencies in a frame of audio data

痞子三分冷 提交于 2019-12-05 05:21:43
问题 I am pretty new to Matlab and I am trying to write a simple frequency based speech detection algorithm. The end goal is to run the script on a wav file, and have it output start/end times for each speech segment. If use the code: fr = 128; [ audio, fs, nbits ] = wavread(audioPath); spectrogram(audio,fr,120,fr,fs,'yaxis') I get a useful frequency intensity vs. time graph like this: By looking at it, it is very easy to see when speech occurs. I could write an algorithm to automate the detection

Matlab: Finding dominant frequencies in a frame of audio data

北战南征 提交于 2019-12-03 21:11:37
I am pretty new to Matlab and I am trying to write a simple frequency based speech detection algorithm. The end goal is to run the script on a wav file, and have it output start/end times for each speech segment. If use the code: fr = 128; [ audio, fs, nbits ] = wavread(audioPath); spectrogram(audio,fr,120,fr,fs,'yaxis') I get a useful frequency intensity vs. time graph like this: By looking at it, it is very easy to see when speech occurs. I could write an algorithm to automate the detection process by looking at each x-axis frame, figuring out which frequencies are dominant (have the highest

Identifying silence at the end of an mp3 using java

可紊 提交于 2019-12-02 07:06:36
问题 Trying to detect silence at the end of audio in mp3 format, well all formats would be useful but mp3 format is the most important 回答1: The only way I know of to reliably detect silence at the end of a sound clip is to convert it to a PCM format and do one of the following calculations checking for a certain minimum cut-off amplitude. Decibels (dB) Root Mean Square (RMS) I've never managed to implement dB, but RMS is relatively simple, and should work for this use. I used it for the small bars