You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
The code you are referencing comes from the method convert_to_mono_audio(input_audio)
This method is used by the class Processing to normalized data sample when instantiating the sound objects, please
have a look at the source code and
__init__()
The method discuss above is used to convert stereophonic sound (2 channels) into a monophonic sound
Also it will divide every sound samples by 2 such as
The error you are getting mean that the object e is not what is supposed to be.
In the example above "e" must be a python list a buffer or a numpy.array containing the data samples, if this is not the case an exception will be raised (IndexError: invalid index to scalar variable), scalar means that the value is most likely to be an integer or a float.
Now, to explain your issue, I would suggest to check what is e in your scenario by adding an extra line to the source code such as
I am strongly suspecting that the object input_audio passed to the method convert_to_mono_audio(input_audio) is not a numpy.array or a python list or any sort of data samples.
for reference :
scipy.io.wavfile.read(filename, mmap=False)[source]
# Return the sample rate (in samples/sec) and data from a WAV file# Returns: | rate : intSample rate of wav filedata : numpy arrayData read from wav file
Your file is most likely to be invalid (try a WAV file instead)
output_audio.append((e[0] / 2) + (e[1] / 2))
Im not sure what this does? ii keep getting this error
The text was updated successfully, but these errors were encountered: