pydub

Pydub raw audio data

橙三吉。 提交于 2020-01-01 19:25:52
问题 I'm using Pydub in Python 3.4 to try to detect the pitch of some audio files. I have a working pitch detection algorithm (McLeod Pitch Method), which is robust for real-time applications (I even made an Android pitch detection app with it: https://github.com/sevagh/Pitcha). My issue is that I'm not getting any meaningful output from the algorithm when I apply it to AudioSegment._data. Code: from pydub import AudioSegment sound = AudioSegment.from_wav(file="./8700hz.wav") #sampling rate =

remove silence at the beginning and at the end of wave files with PyDub

人走茶凉 提交于 2019-12-31 10:03:19
问题 How can I remove the silence from the beginning and the end of wave files with PyDub? I guess I should access segment by segment and check whether it's silent or not (but I'm not able to do it) :/ e.g. I have a wave file with silence at the beginning, end, or both (like below) and I want to remove the silence at the beginning and at the end of the file: e.g. I want to import it sound = AudioSegment.from_wav(inputfile) cycle for every sample of sound to check whether it's silent and mark the

How to change audio playback speed using Pydub?

若如初见. 提交于 2019-12-25 00:43:18
问题 I am new learner of audio editing libs - Pydub. I want to change some audio files' playback speed using Pydub(say .wav/mp3 format files), but I don't know how to make it. The only module I saw that could possibly deal with this problem is speedup module in effect.py. However, there is no explanation about how I am supposed to call it. Could anyone kindly explain how to do this task in Pydub? Many thanks! (A related question: Pydub - How to change frame rate without changing playback speed,

Error when exporting with pydub - how to install mp3 codecs for pydub?

岁酱吖の 提交于 2019-12-24 01:27:35
问题 Im using this library for first time so Im not sure if this is a bug or Im not correctly doing something. I want to export a file into mp3, the loading works perfectly: wav=AudioSegment.from_wav(Path) #If I execute only this line, there are no errors. But when I try to export my file to mp3: wav.export(r"WavOut.mp3",format="mp3") It throws the following error: WindowsError: [Error 2] The system cannot find the file specified Full error report: http://pastebin.com/3CpZBkEK I believe I am using

why am i getting error when importing AudioSegment?

拟墨画扇 提交于 2019-12-22 13:45:09
问题 i'm trying to use pydub, but when i import it to python with AudioSegment it will give me an error saying it doesn't recognize it. i tried using pip install and searching online. any help?? i'm using python 2.7 from pydub import AudioSegment 回答1: Can u uninstall and try installing using pip install pydub. Also make sure pydub path is in the PYTHONPATH or system PATH . What OS are you using? find out where pydub got installed. I've in C:\Python27\Lib\site-packages\pydub . Open a command-prompt

Is it possible to compare two similar songs given their wav files?

房东的猫 提交于 2019-12-22 10:44:11
问题 I have a large library of older music (1920s, 30s, 40s, etc), with a lot of duplicates, and I'd like to determine the duplicates and organize them with the same MP3 tag information. Since the music was recorded a while ago, while they may sound similar to a human ear, their recording might actually be a bit different (quieter, more static, etc). I'm currently parsing some of the music using pydub and am able to generate the wav file, remove the silence at the beginning and end of the songs,

how to play mp3

眉间皱痕 提交于 2019-12-21 04:31:24
问题 my problem starts here: pyttsx and gTTS module errors gTTS works well, takes text from text file, but first creates mp3 file, then if I want listen, I must call this mp3, so it is good but it would be better if I can avoid any audio files, and get just read from text file. maybe somehow I can use google voice to read from text file..? anyway main question now is other if I can use only gTTS what is the best way to play mp3 on Windows 10-64 bit, Python 3.5 ok with os: import os os.startfile("D

Pydub - combine split_on_silence with minimum length / file size

一世执手 提交于 2019-12-18 16:51:25
问题 I have two scripts, one of them splits audio of a certain length, the other one splits audio on every time there is a silent passage. Would it be possible to split the audio on silence, but only after a certain time passed? I would need chunks of videos split on silence which are not shorter than 5 minutes. Splitting script with ignores silence: from pydub import AudioSegment #from pydub.utils import mediainfo from pydub.utils import make_chunks import math #lac_audio = AudioSegment.from_file

pydub append - clarification of under the hood behaviour

跟風遠走 提交于 2019-12-13 16:08:07
问题 I've been using pydub to concatenate short sound files into a larger sound file. The basic code for this looks like this: def permuPhrase(iterations, joins): # Builds a single phrase and does various permutations of it sampleSet = entryMatcher() sampleSet.inputVars() sampleSet.match() concat = 0 if len(sampleSet.results) != 0: for x in range(iterations): for i in range(joins): rand = rn.randint(0, len(sampleSet.results)- 1) choice = str(sampleSet[rand]) concat += (AudioSegment.from_wav(source

What audio formats are supported by Azure Cognitive Services' Speech Service (SST)?

风格不统一 提交于 2019-12-11 03:08:13
问题 Bearing in mind that the Microsoft/Azure Cognitive Services' "Speech Service" is currently going through a rationalisation exercise, as far as I can tell from looking at https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/rest-apis#speech-to-text https://docs.microsoft.com/en-us/azure/cognitive-services/speech/home only .wav binaries are acceptable, with anything else giving the response: {"Message":"Unsupported audio format"} Is there any other way to discover the