{"id":53,"date":"2013-03-24T19:24:10","date_gmt":"2013-03-24T19:24:10","guid":{"rendered":"http:\/\/ggkarman.de\/tech\/?p=53"},"modified":"2013-05-01T15:08:34","modified_gmt":"2013-05-01T15:08:34","slug":"changing-the-header-properties","status":"publish","type":"post","link":"https:\/\/ggkarman.de\/tech\/changing-the-header-properties\/","title":{"rendered":"Playing with the sampling rate"},"content":{"rendered":"<p>1. Writing a user-specified sampling rate to the header of an audio file:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\nsox -r 48k source.wav destiny.wav\r\n\r\n<\/pre>\n<p>Audio applications will now interpret destiny.wav as a 48 KHz file, even if this is different from the sampling rate originally used to record the file. In that case the pitch and duration of the file with be changed (akin to altering the playback speed of analogue media). I use this occasionally to fix things (or to break them on purpose..).<\/p>\n<p>2. Resampling: <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsox source.wav -r 48k destiny.wav\r\n<\/pre>\n<p>modifies the audio data in the file without altering the pitch and duration of the recording.  The <strong>rate<\/strong> effect can be used for the same purpose:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">sox source.wav destiny.wav rate -v 48k<\/pre>\n<p>(-v = Very High Quality Resampling, the documentation recommends to use this option for bit depths > 16 bit)<br \/>\nFor further options see <a href=\"http:\/\/sox.sourceforge.net\/SoX\/Resampling\" target=\"_blank\">here<\/a> and <a href=\"http:\/\/sox.sourceforge.net\/Docs\/FAQ\" target=\"_blank\">here<\/a>.<\/p>\n<p>3. The <strong>speed<\/strong> effect is actually a combination of #1 and #2:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsox source.wav destiny.wav speed 1.0884\r\n<\/pre>\n<p>changes the playback speed of the source file by a certain ratio, and resamples it back to the source sampling rate.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Writing a user-specified sampling rate to the header of an audio file: Audio applications will now interpret destiny.wav as a 48 KHz file, even if this is different from the sampling rate originally used to record the file. In that case the pitch and duration of the file with be changed (akin to altering [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/posts\/53"}],"collection":[{"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":133,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/posts\/53\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ggkarman.de\/tech\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}