{"id":290,"date":"2021-01-17T23:55:00","date_gmt":"2021-01-17T23:55:00","guid":{"rendered":"https:\/\/www.cybermosaic.co.uk\/?p=290"},"modified":"2021-01-17T23:58:49","modified_gmt":"2021-01-17T23:58:49","slug":"sampling-sound-from-pictures","status":"publish","type":"post","link":"https:\/\/www.cybermosaic.co.uk\/?p=290","title":{"rendered":"Sampling Sound From Pictures"},"content":{"rendered":"<p>A great video came up in my YouTube feed today. A video from the excellent Computerphile channel caught my eye. It concerned turning pictures of sound waves back into audio files. It was entitled\u00a0How NOT to Sample Audio!<\/p>\n<p><iframe title=\"How NOT to Sample Audio! - Computerphile\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/VQOdmckqNro?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>The basic method used was as follows:<\/p>\n<ul>\n<li><span style=\"font-family: Exo;\">Get a screen grab of a sound file waveform (in the time domain)<\/span><\/li>\n<li><span style=\"font-family: Exo;\">Loop through the columns of the BMP picture file to find and extract the approximation of the waveform<\/span><\/li>\n<li><span style=\"font-family: Exo;\">Brightness is used to detect if the difference between background and the sound<\/span><\/li>\n<li><span style=\"font-family: Exo;\">A loop is used to pick out column max and min heights<\/span><\/li>\n<li><span style=\"font-family: Exo;\">Store these values as the sound (basically a series of values<\/span><\/li>\n<li><span style=\"font-family: Exo;\">To compensate for low resolution, a stretch is required to make up for fact the resolution of the image is less in columns than you would have samples, in an audio file<\/span><\/li>\n<li><span style=\"font-family: Exo;\">Values added between samples to enable the stretch<\/span><\/li>\n<li><span style=\"font-family: Exo;\">Add the WAV file header information to the series of numbers you have created<\/span><\/li>\n<\/ul>\n<p>In the example in the film, an\u00a08 Bit sound generated in a 35k file (ASCII). Clearly the\u00a0WAV to graphics accuracy is dependant on the number of screen pixels used.<\/p>\n<p>The result reminded me of the first voice synthesis I heard from the Commodore 64 game, Ghostbusters! The magic of hearing &#8220;you slimed me&#8221; is etched in my mind,<\/p>\n<p>Reading the comments on the video I also noticed someone had mentioned a fascinating project called the Visual Microphone. A quick search of the internet revealed the following paper and website. The Visual Microphone: Passive Recovery of Sound from Video<\/p>\n<p><a href=\"http:\/\/people.csail.mit.edu\/mrub\/VisualMic\/\">http:\/\/people.csail.mit.edu\/mrub\/VisualMic\/<\/a><\/p>\n<p>That looks like the next rabbit hole to dive down\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A great video came up in my YouTube feed today. A video from the excellent Computerphile channel caught my eye. It concerned turning pictures of sound waves back into audio files. It was entitled\u00a0How NOT to Sample Audio! The basic method used was as follows: Get a screen grab of a sound file waveform (in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-290","post","type-post","status-publish","format-standard","hentry","category-dsp","category-sec"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=290"}],"version-history":[{"count":4,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":296,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/290\/revisions\/296"}],"wp:attachment":[{"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cybermosaic.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}