0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Unknown encoder 'pcm_s4le'

Posted at

python の AudioSegment.from_file で Unknown encoder 'pcm_s4le' というエラーがでる。

これなんだけど

なので、

from pydub import AudioSegment
import soundfile as sf

filen = 'orig.wav'
fileo = 'converted.wav'

f = sf.SoundFile(filen)
print(f.format, f.subtype, f.endian)

sig, sr = sf.read(filen)
print(sr)

sf.write(fileo, sig, sr, format="wav", subtype='PCM_16')

as = AudioSegment.from_file(fileo, format="wav")

として、PCM_16 に変換してやればいい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?