-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get audio? #8
Comments
Hi, Thank you for your interest in my code and project. In case of extracting audio files from videos, I used The command below is what I used.
Please also consider using In objects-that-sound/utils/extractor.py Lines 91 to 137 in d19f971
Here are some detailed explanation of the source code above:
In addition, as using mel-spectrogram is a trend of audio processing procedure, I hope this answer might help you understand the procedure of extracting and preprocessing audio. If you have any more questions, please do not hesitate to leave an issue. Thanks. |
Hello, I'm trying to use your model to test my video. And my location is terrible. How do you process video to get audio?
This is how I extract audio:
from moviepy.editor import *
audioclip = AudioFileClip(video_path) #read video
audioclip.write_audiofile(audio_path, 48000) #save as wav
The shape of the read audio data is (n * 2), so I can only take the average value so that the program can run normally.
extractor.py:
rate, sample = wavfile.read(aud_path)
sample = np.mean(sample, 1) #todo: I added it myself
But my location is terrible, so I'd like to know how you extract audio from your own video.
In addition, do you have a good positioning effect?
The text was updated successfully, but these errors were encountered: