Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Docstrings #14

Open
skrungly opened this issue Jul 20, 2018 · 17 comments
Open

Docstrings #14

skrungly opened this issue Jul 20, 2018 · 17 comments

Comments

@skrungly
Copy link

skrungly commented Jul 20, 2018

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.

@mpariente
Copy link

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

@DannyDannyDanny
Copy link

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

@carlthome
Copy link
Owner

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

@rudytrubitt
Copy link
Contributor

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

@rudytrubitt
Copy link
Contributor

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

@rudytrubitt
Copy link
Contributor

rudytrubitt commented Nov 2, 2018

@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
Copy link
Contributor

rudytrubitt commented Nov 2, 2018

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
Copy link
Contributor

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

@grprksh
Copy link

grprksh commented Nov 17, 2018

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

@rudytrubitt
Copy link
Contributor

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

@grprksh
Copy link

grprksh commented Nov 18, 2018

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

@rudytrubitt
Copy link
Contributor

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?

@grprksh
Copy link

grprksh commented Nov 18, 2018

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)

@rudytrubitt
Copy link
Contributor

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 mozilla/DeepSpeech#1319 or Homebrew/legacy-homebrew#35643 .

@DannyDannyDanny
Copy link

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

@rudytrubitt
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants