generated from PeoplePlusAI/the-project-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I think there is a minor bug in the code snippet below
For stereo sound, when converting to mono, the datatype of audio_data becomes float64 because for np.mean the default return type for integer inputs is float64. On passing this float variable to np.iinfo, we will get an error as the iinfo function works only for integer types
Potential solution
- Specify the output datatype as np.int16 in np.mean
audio_data.mean(axis=1, dtype=np.int16) - Use np.finfo for stereo sounds
I think the first approach is better, but would love to know others thoughts
Metadata
Metadata
Assignees
Labels
No labels