Reputation: 1
I'm trying to encode a .wav file with the flac CLI to reduce its size. The file was generated with the python wave package, and contains an hour of silence.
Here is the code that generated the file
def silence(num_seconds):
for frame in range(round(num_seconds)):
yield 0
with wave.open("silence.wav", mode="wb") as wav_file:
wav_file.setnchannels(1)
wav_file.setsampwidth(1)
wav_file.setframerate(1)
wav_file.writeframes(bytes(silence(60*60)))
This file is readable by all my media players (VLC, foobar2000, windows media player)
But when I try to encode it using flac, using this command :
flac silence.wav
The resulting silence.flac file is unreadable by any media players (VLC doesn't open it, Windows media player and foobar2000 displays the file and length but wont let me press play, and foobar throws an error
I tried encoding a sample .wav file from somewhere else with the same flac command and it worked flawlessly
What could cause this ? Flac doesn't throw any error when encoding the file, why cant I open it anywhere ?
Here is some info about the generated .wav file: bitrate 8b/s, 1Hz, 1 channel, format is PCMWaveFormat, 8bit depth
Upvotes: 0
Views: 65