audio

detecting the index of silence from a given audio file using python

时光毁灭记忆、已成空白 提交于 2020-07-05 05:12:47
问题 I am trying to process an audio file in python using various modules like numpy, struct etc. But I am really having a hard time detecting silence in the file, as in where is the presence of silence. one on the methods I came across was to slide a window of fixed time interval over my audio signal and record the sum of squared elements. I am new to python and hardly aware of it thus unable to implement this method. 回答1: If you are open to outside libraries, one of the quick way to do is using

detecting the index of silence from a given audio file using python

不羁的心 提交于 2020-07-05 05:12:32
问题 I am trying to process an audio file in python using various modules like numpy, struct etc. But I am really having a hard time detecting silence in the file, as in where is the presence of silence. one on the methods I came across was to slide a window of fixed time interval over my audio signal and record the sum of squared elements. I am new to python and hardly aware of it thus unable to implement this method. 回答1: If you are open to outside libraries, one of the quick way to do is using

Playing an audio file repeatedly with AVAudioEngine

試著忘記壹切 提交于 2020-07-05 04:15:27
问题 I'm working on an iOS app with Swift and Xcode 6. What I would like to do is play an audio file using an AVAudioEngine, and until this point everything OK. But how can I play it without stopping, I mean, that when it ends playing it starts again? This is my code: /*==================== CONFIGURATES THE AVAUDIOENGINE ===========*/ audioEngine.reset() //Resets any previous configuration on AudioEngine let audioPlayerNode = AVAudioPlayerNode() //The node that will play the actual sound

Playing an audio file repeatedly with AVAudioEngine

故事扮演 提交于 2020-07-05 04:14:11
问题 I'm working on an iOS app with Swift and Xcode 6. What I would like to do is play an audio file using an AVAudioEngine, and until this point everything OK. But how can I play it without stopping, I mean, that when it ends playing it starts again? This is my code: /*==================== CONFIGURATES THE AVAUDIOENGINE ===========*/ audioEngine.reset() //Resets any previous configuration on AudioEngine let audioPlayerNode = AVAudioPlayerNode() //The node that will play the actual sound

Real-time audio signal processing using python

蹲街弑〆低调 提交于 2020-07-04 13:51:31
问题 I have been trying to do real-time audio signal processing using 'pyAudio' module in python. What I did was a simple case of reading audio data from microphone and play it via headphones. I tried with the following code(both Python and Cython versions). Thought it works but unfortunately it is stalls and not smooth enough. How can I improve the code so that it will run smoothly. My PC is i7, 8GB RAM. Python Version import pyaudio import numpy as np RATE = 16000 CHUNK = 256 p = pyaudio.PyAudio

What's the interleaved audio ? [closed]

房东的猫 提交于 2020-07-03 09:34:24
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Improve this question i see this interleaved audio many times on core audio documents.Can someone explain me what's really functionality of this property. 回答1: Generally speaking, if you have 2 channels, let's call them L for left and R for right, and you want to transmit or store 20

create html <audio> element from Tone.js object

故事扮演 提交于 2020-06-29 03:52:26
问题 I am using Tone.js to modify sounds: audio_url = "/sounds/damncoolbeats.m4a" player = new Tone.Player(audio_url) modified_player = <some Tone.js modifications to player> To play the modified sound I would like to use a web audio element so that I can make use of audio.currentTime and eventlisteners to 'play' 'pause' and 'timeupdate' (which I can't seem to do with Tone.js). The only way I managed to create an audio element so far is by loading from an url: audio = new Audio(audio_url) My

Copying avcodec parameters

假如想象 提交于 2020-06-28 06:35:54
问题 I am trying to use libav to convert an MP4 file to an MP3 file. Basically trying to achieve what ffmpeg -i filename.mp4 filename.mp3 does. I've found this official example. But when I run it with an input MP4 and an output MP3 I get an error: Invalid audio stream. Exactly one MP3 audio stream is required. I am not at all familiar with this library but I think I have narrowed the problem down to this line: ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar); It seems to copy all

MediaDevices.getUserMedia() How can I set audio constraints (sampling rate/bit depth)?

我们两清 提交于 2020-06-28 06:01:40
问题 With browser Web API, I'd like to set MediaDevices.getUserMedia constraints attributes, suitable to record audio speech (voice messages), e.g. setting these parameters: mono 16bit 16KHz Here my code: const mediaStreamConstraints = { audio: { channelCount: 1, sampleRate: 16000, sampleSize: 16, volume: 1 }, video: false } navigator.mediaDevices.getUserMedia(mediaStreamConstraints) .catch( err => serverlog(`ERROR mediaDevices.getUserMedia: ${err}`) ) .then( stream => { // audio recorded as Blob

python webrtc voice activity detection is wrong

让人想犯罪 __ 提交于 2020-06-27 11:17:36
问题 I need to do voice activity detection as a step to classify audio files. Basically, I need to know with certainty if a given audio has spoken language. I am using py-webrtcvad, which I found in git-hub and is scarcely documented: https://github.com/wiseman/py-webrtcvad Thing is, when I try it on my own audio files, it works fine with the ones that have speech but keeps yielding false positives when I feed it with other types of audio (like music or bird sound), even if I set aggressiveness at