From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 610BD200B9 for ; Sun, 6 May 2018 15:40:48 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fFLmF-0003PW-Ca; Sun, 06 May 2018 15:40:43 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fFLmB-0003P3-DF for sox-users@lists.sourceforge.net; Sun, 06 May 2018 15:40:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S/e2B5ForyerCtp43ufOj1oqMx+tX2L9OKWOPxR4Vuo=; b=CyFDFaqi+FSrW3YecYnfIVJOmr Qde/+YJxhkuHYp8I48Jo7FAd4X/Yd7EC3w7PB7cu8/YaCROUTnllVzANoHYtPXa+ItWrEieUA0Ng/ t+GeWOoAC1u6lv/vmgbhTJL17VdTbbALW0UimHcvB7f6wDELEeWm5iiiG1qeZUljhrLs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=S/e2B5ForyerCtp43ufOj1oqMx+tX2L9OKWOPxR4Vuo=; b=cGmwz12PKLbb38XNismhraaDmo 51UMaj4eeCLz2BqBs7o2QtvxNwia60vfHfuehzyPU+xeIP86B970cT8dpZ261hsbHVl+vqKiuVS+Q c2ZDvKvaPobfHNy980VlxBwfzJNgx+FshYm6urMvTWMi/oX10x/uHHWf0d2fPqnfDj2s=; Received: from unicorn.mansr.com ([81.2.72.234]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fFLm9-0089Gg-3I for sox-users@lists.sourceforge.net; Sun, 06 May 2018 15:40:39 +0000 Received: by unicorn.mansr.com (Postfix, from userid 51770) id 1ABD116402; Sun, 6 May 2018 16:40:19 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Shailendra Paliwal References: Date: Sun, 06 May 2018 16:40:19 +0100 In-Reply-To: (Shailendra Paliwal's message of "Sun, 6 May 2018 17:23:43 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Headers-End: 1fFLm9-0089Gg-3I Subject: Re: Can I use sox to glitch images? X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Cc: sox-users@lists.sourceforge.net Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: sox-users-bounces@lists.sourceforge.net Shailendra Paliwal writes: > On Sat, May 5, 2018 at 4:43 PM, M=E5ns Rullg=E5rd wrote: > >> Shailendra Paliwal writes: >> >> > Hello, >> > >> > I found sox as a command-line equivalent of Audacity. I was wondering = how >> > can I glitch images like the way I can using Audacity. >> > >> > On audacity the usual modus operandi is, >> > >> > 1. Use Audacity > File > Import > Raw Data, to import a BMP image >> file. >> > 2. Set the encoding to U-Law or A-Law. >> > 3. Apply audio effects to the track. >> > 4. Export Audio, set Save As Type > Other Uncompressed Files >> > 5. Header > RAW (header-less) and Encoding > whichever selected in = (2) >> > 6. Rename to BMP >> > >> > I was wondering if the same method can be used with sox. That way I can >> > make shell scripts to glitch images or even thousands of frames in a >> video. >> >> Yes, this can be done. Try something like this: >> >> $ sox -t ul -c 1 -r 48k input -t ul output effects... >> > This seems to corrupt the header of the file too and then I cannot open it > at all. Usually in Audacity, I would not touch the first 5% of the track > assuming it contains the header information that should be left untouched. Yes, of course. I assumed you had some way of dealing with that. > So, I thought if I can split the header and the file contents into two > file. That would be easy to run through sox. > > I tried > $ sox -t ul -c 1 -r 48k water.bmp -t ul water_out trim 0 15 : newfile : > restart > > This should work because new headers aren't created while spitting and I > checked this by merging these files back (I'm on windows) > $ type water_out* > water_databent.bmp You should also be able to simply do this: = $ sox -t ul -c 1 -r 48k water.bmp -t ul water_out trim 0 100s : effects ... That will pass through the first 100 samples (enough to skip the BMP header) unchanged, then apply the specified effects to the remainder of the file. > This get me the image again. > > However, I processed one chunk with an audio effect and the file size > reduced drastically from ~700KB to ~2KB. Would you know why did that > happen? I did > $ sox -t ul -c 1 -r 48k water_out002 -t ul water_out002 echo 0.8 0.7 45 0= .31 If you trimmed 15 seconds from the start of the file, that would be about 700 kB at 48 kHz. -- = M=E5ns Rullg=E5rd ---------------------------------------------------------------------------= --- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users