Audio-Signal-Processing
Audio-Signal-Processing copied to clipboard
ValueError: operands could not be broadcast together with shapes (472000,) (472000,2)
NewSound = GuassianNoise + array Traceback (most recent call last):
File "
ValueError: operands could not be broadcast together with shapes (472000,) (472000,2)
The arrays are not the same shape.........
I know that but the process you defined will give this structure at that point
On Fri, Dec 14, 2018 at 10:58 AM Rudra [email protected] wrote:
The arrays are not the same shape.........
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidpraise45/Audio-Signal-Processing/issues/2#issuecomment-447218129, or mute the thread https://github.com/notifications/unsubscribe-auth/AVYJOjGZXdbilkEOyy2gPFUivDq96facks5u4zbugaJpZM4ZQ7rA .
NewSound = np.zeros_like(array) # or array which has shape (472000, 2)
for i in range(2):
'''If line below gives error, then try doing this - :, i
If the line still gives the error, then move this part [i, :] next to GuassianNoise and
then change the line NewSound = np.zeros_like(array) to NewSound =
np.zeros_like(GuassianNoise)'''
NewSound[i, :] = GuassianNoise + array[i, :]
Or something like that
not working @rudrathegreat
Same issue can anyone, guide me through this. Please can you give an update if there is any?
Hi Guys sorry for the late reply.
Hmmm.... Can't really say much about this problem. I think you need to either -
- Read the NumPy documentation
- Find a similar problem and see how they solved it
- Debug your code in some IDE that allows you to see the shape and content of the array
GuassianNoise shape is (n, ) and array shape is (n, 2) Change array shape (n,2) to (n, ) so just change -> NewSound = GuassianNoise + array[:, 1] not NewSound = GuassianNoise + array
ValueError Traceback (most recent call last)
ValueError: setting an array element with a sequence.
i didn't get that. can i anyone suggest me to solve this error? @saurabhbidwai @rudrathegreat @rakky18 @shreyask724 @JinSolChoi @davidpraise45
Again, I am just a 13-year old Python Developer, I have still got a lot to learn. I'm sorry but I can't help in this issue. I'm not an expert.
Hello, I have a question. The code was executed perfectly and the new wav file was created but it refuses to be played. How do I solve this?
I've experienced similar problems when generating wav files using scipy in general. It's just that the bit rate is way to high, like 18786kbps or something insane like that