{"id":839,"date":"2015-07-06T15:40:45","date_gmt":"2015-07-06T10:40:45","guid":{"rendered":"http:\/\/alexeyka.zantsev.com\/?p=839"},"modified":"2021-12-24T22:32:31","modified_gmt":"2021-12-24T17:32:31","slug":"sox-mp3-to-wav","status":"publish","type":"post","link":"https:\/\/alexeyka.zantsev.com\/?p=839","title":{"rendered":"sox, ffmpeg: mp3 to wav, gsm to wav"},"content":{"rendered":"\n<p><strong>m4a to wav:<\/strong><\/p>\n\n\n\n<p><kbd>ffmpeg -i audiofile.m4a audiofile.wav<\/kbd><\/p>\n\n\n\n<p><strong>MP3 to WAV:<\/strong><br><code>user@pc:~$ sox -t mp3 fromfile.mp3 -t wav -r 8k tofile.wav channels 1<\/code><br><code>user@pc:~\/Downloads$ file tofile.wav<br>\ntofile.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz<\/code><\/p>\n\n\n\n<p>or using mpg321:<\/p>\n\n\n\n<p><code>mpg321 -w output.wav input.mp3<\/code><\/p>\n\n\n\n<p><strong>GSM to WAV:<\/strong><br><code>lexus@lexus:~$ sox beep2.gsm -r 8000 --encoding=signed-integer beep2.wav channels 2<\/code><br><code>lexus@lexus:~$ file beep2.wav<br>\nbeep2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 8000 Hz<\/code><\/p>\n\n\n\n<p><strong>OGG to WAV:<\/strong><br><code>lexus@lexus:~$ ffmpeg -i in_file.ogg out_file.wav<\/code><\/p>\n\n\n\n<p>Change WAV file bitrate from 44100 to 8000:<br><code>lexus@lexus:~$ file file44100.wav<br>\nfile44100.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz<br>\nlexus@lexus:~$ sox file44100.wav -r 8000 file8000.wav<br>\nsox WARN rate: rate clipped 12 samples; decrease volume?<br>\nsox WARN dither: dither clipped 8 samples; decrease volume?<\/code><\/p>\n\n\n\n<p>For newer versions of sox, working example:<\/p>\n\n\n\n<p><strong>stereo to mono:<\/strong><br><code>sox stereo.wav mono.wav channels 1<\/code><\/p>\n\n\n\n<p><strong>44100 t0 8000:<\/strong><br><code>sox big.wav small.wav rate 8000<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>m4a to wav: ffmpeg -i audiofile.m4a audiofile.wav MP3 to WAV:user@pc:~$ sox -t mp3 fromfile.mp3 -t wav -r 8k tofile.wav channels 1user@pc:~\/Downloads$ file tofile.wav tofile.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz or using mpg321: mpg321 -w output.wav input.mp3 GSM to WAV:lexus@lexus:~$ sox beep2.gsm -r 8000 &#8211;encoding=signed-integer beep2.wav channels 2lexus@lexus:~$ file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[220,207],"class_list":["post-839","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ffmpeg","tag-sox"],"_links":{"self":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=839"}],"version-history":[{"count":13,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/839\/revisions"}],"predecessor-version":[{"id":12177,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/839\/revisions\/12177"}],"wp:attachment":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}