Open Looki2000 opened 1 year ago
I want to save sine wave as audio file in its original quality.
The exported file have many sample skipping which results in a very awful sounding audio.
import moviepy.editor as mp from moviepy.audio.AudioClip import AudioArrayClip import numpy as np
audio_sample_rate = 48000
duration = 48000 time = np.arange(duration) frequency = 500 audio = np.sin(2 np.pi frequency (time / 24000)) 0.9
audio = np.repeat(audio, 2).reshape((-1, 2))
audio_clip = AudioArrayClip(audio, fps=audio_sample_rate)
audio_clip.write_audiofile("audio.wav", fps=audio_sample_rate)
2. Listen to audio.wav and see in the audacity how bad the waveform looks. #### Specifications - Python Version: 3.11.3 - MoviePy Version: 1.0.3 - Platform Name: Windows - Platform Version: 10
Expected Behavior
I want to save sine wave as audio file in its original quality.
Actual Behavior
The exported file have many sample skipping which results in a very awful sounding audio.
Steps to Reproduce the Problem
audio_sample_rate = 48000
duration = 48000 time = np.arange(duration) frequency = 500 audio = np.sin(2 np.pi frequency (time / 24000)) 0.9
mono to stereo
audio = np.repeat(audio, 2).reshape((-1, 2))
create audio clip
audio_clip = AudioArrayClip(audio, fps=audio_sample_rate)
audio_clip.write_audiofile("audio.wav", fps=audio_sample_rate)