python-audio-effects icon indicating copy to clipboard operation
python-audio-effects copied to clipboard

Docstrings

Open skrungly opened this issue 6 years ago • 17 comments

It would be much easier to use this if each of the AudioEffectsChain effect methods had docstrings. Right now it's necessary to dig through the source code to find which arguments to use.

skrungly avatar Jul 20 '18 18:07 skrungly

I agree with @kingdom5500, I'd be ready to write docstrings on the effects I'll use.

mpariente avatar Jul 23 '18 19:07 mpariente

I'd love to help, how does it work? I clone like I usually would, add docstrings. Then what? 🙈

DannyDannyDanny avatar Oct 31 '18 13:10 DannyDannyDanny

@DannyDannyDanny, fork the project, make code changes and send a pull request! https://guides.github.com/introduction/flow/

carlthome avatar Oct 31 '18 13:10 carlthome

@DannyDannyDanny , I can help with some of these too. If you want to assign a few to me I'll work on them.

rudytrubitt avatar Nov 01 '18 00:11 rudytrubitt

I've started at the top of the list (equalizer) and am working down.

rudytrubitt avatar Nov 01 '18 20:11 rudytrubitt

@carlthome , I'm making good progress on the doc strings, but I'm having trouble with bend. Can you give me a working example of how to use this function? It's not clear how to format the three numeric value that are part of each bend. Thanks!

rudytrubitt avatar Nov 02 '18 03:11 rudytrubitt

And I have a similar question regarding chorus. These effects appear to require a single parameter (like "bends" and delays" that are made up of several numbers. I've tried quoting a group of values, and even tried making them a list as shown below, but so far nothing I've tried is working.

fx = (
    AudioEffectsChain()
    .chorus(0.7, 0.9, [55, 0.4, 0.25, 2])
)

rudytrubitt avatar Nov 02 '18 03:11 rudytrubitt

I've added doc strings to most effects that lacked them and created a pull request. Cheers, Rudy

rudytrubitt avatar Nov 14 '18 17:11 rudytrubitt

I've added doc strings to most effects that lacked them and created a pull request. Cheers, Rudy

Hi Rudy,

I needed to use this library for an academic project of mine but I was getting the error '.[WinError 2] The system can not find the file specified'. Can you please help me with this as you are working on it.

Thanks

grprksh avatar Nov 17 '18 19:11 grprksh

i have been using this on Mac OS and have not seen this error. Sorry, not sure what to suggest.

rudytrubitt avatar Nov 17 '18 22:11 rudytrubitt

Hi, Thank you for your response. I have tried using Mac and I was getting the same error. I am attaching the file, can you please check if possible

guru.zip

grprksh avatar Nov 18 '18 16:11 grprksh

sorry, but i won’t be opening your unsolicited zip file. i note that you have no github history. maybe if you tell us more about your project, and your interest in python and sox?

rudytrubitt avatar Nov 18 '18 17:11 rudytrubitt

Hi, I am sorry for sending the zip file.

I am working on an academic project to classify the heartsounds. I wanted to ignore the background noise and I found this package but was unable to use this because of the error. The zip files contained the error, an audio file and my python script.

default _screenshot 2018-11-18 at 16 38 21 screenshot 2018-11-18 at 16 50 15

Python_First:

import librosa from pysndfx import AudioEffectsChain import numpy as np import math import python_speech_features import scipy as sp import os from scipy import signal #assert os.path.isfile('C:/Users/HARISH/Downloads/Guru/train/a0001.wav') y, sr = librosa.load('Macintosh HD/Users/kabbie/Downloads/a0001.wav',sr = None) cent = librosa.feature.spectral_centroid(y=y, sr=sr) threshold_h = round(np.median(cent))*1.5 threshold_l = round(np.median(cent))*0.1 less_noise = (AudioEffectsChain().lowshelf(gain=-30.0, frequency=threshold_l, slope=0.8).highshelf(gain=-12.0, frequency=threshold_h, slope=0.5)) y_clean = less_noise('Macintosh HD/Users/kabbie/Downloads/a0001_sc.wav')

Python Secon:

import librosa from pysndfx import AudioEffectsChain import numpy as np import math import python_speech_features import scipy as sp import os import sox from scipy import signal #assert os.path.isfile('C:/Users/HARISH/Downloads/Guru/train/a0001.wav') y, sr = librosa.load('a0001.wav',sr = None) cent = librosa.feature.spectral_centroid(y=y, sr=sr) threshold_h = round(np.median(cent))*1.5 threshold_l = round(np.median(cent))*0.1 less_noise = (AudioEffectsChain().lowshelf(gain=-30.0, frequency=threshold_l, slope=0.8).highshelf(gain=-12.0, frequency=threshold_h, slope=0.5)) y_clean = less_noise(y)

grprksh avatar Nov 18 '18 18:11 grprksh

From your screenshot: sox could not be found! Your issue does not appear to be related to python-audio-effects. SoX appears to be installed, but not in a directory that is in your PATH. This isn't an appropriate forum to try and debug this, I suggest https://github.com/mozilla/DeepSpeech/issues/1319 or https://github.com/Homebrew/legacy-homebrew/issues/35643 .

rudytrubitt avatar Nov 20 '18 03:11 rudytrubitt

@rudytrubitt Cool beans! Can I still contribute? Or are you getting to a point where I'll be a nuissance more than help?

DannyDannyDanny avatar Nov 24 '18 14:11 DannyDannyDanny

Hi @DannyDannyDanny , if you can document bend and chorus, that would be great. I was not able to create a working test example of those, it is not clear to me what syntax is required for all the settings for these effects.

Carl asked me to run docformatter to ensure a consistent formatting which I will get to shortly. If you could do the same with your additions, that would be great. https://pypi.org/project/docformatter/ https://github.com/myint/docformatter#wrapping-descriptions

You can see what I've created docstrings for up to now in my repo: https://github.com/rudytrubitt/python-audio-effects.git

rudytrubitt avatar Nov 24 '18 18:11 rudytrubitt

Hello @carlthome,

I’ve run docformater on my changes and updated my repo at (https://github.com/rudytrubitt/python-audio-effects.git).

Initially I thought I’d create a new pull request, but now I’m thinking that’s not necessary. I do see there are changes to master so that a merge is necessary. Let me know if you need anything else.

Cheers rudy

rudytrubitt avatar Nov 25 '18 21:11 rudytrubitt