sox-users@lists.sourceforge.net unofficial mirror
 help / color / Atom feed
* Can I use sox to glitch images?
@ 2018-05-04 15:51 Shailendra Paliwal
  2018-05-05 11:13 ` Måns Rullgård
  0 siblings, 1 reply; 6+ messages in thread
From: Shailendra Paliwal @ 2018-05-04 15:51 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 664 bytes --]

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.

Cheers

Shailendra

[-- Attachment #1.2: Type: text/html, Size: 786 bytes --]

<div dir="ltr"><div><div>Hello,<br><br></div>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.<br><br></div>On audacity the usual modus operandi is, <br><ol><li>Use Audacity &gt; File &gt; Import &gt; Raw Data, to import a BMP image file.</li><li>Set the encoding to U-Law or A-Law.</li><li>Apply audio effects to the track.</li><li>Export Audio, set Save As Type &gt; Other Uncompressed Files</li><li>Header &gt; RAW (header-less) and Encoding &gt; whichever selected in (2)</li><li>Rename to BMP</li></ol><p>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.</p><p>Cheers<br></p><p>Shailendra<br></p></div>

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I use sox to glitch images?
  2018-05-04 15:51 Can I use sox to glitch images? Shailendra Paliwal
@ 2018-05-05 11:13 ` Måns Rullgård
  2018-05-06 10:33   ` James Trammell
  2018-05-06 11:53   ` Shailendra Paliwal
  0 siblings, 2 replies; 6+ messages in thread
From: Måns Rullgård @ 2018-05-05 11:13 UTC (permalink / raw)
  To: Shailendra Paliwal; +Cc: sox-users

Shailendra Paliwal <beingshailendra@gmail.com> 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...

-- 
Måns Rullgård

------------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I use sox to glitch images?
  2018-05-05 11:13 ` Måns Rullgård
@ 2018-05-06 10:33   ` James Trammell
  2018-05-06 12:18     ` Shailendra Paliwal
  2018-05-06 11:53   ` Shailendra Paliwal
  1 sibling, 1 reply; 6+ messages in thread
From: James Trammell @ 2018-05-06 10:33 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 1575 bytes --]

Shailendra,

Glitching images seems like a cool idea and has me curious: what do you use
this for? Are you hiding audio messages in images, as in steganography?

Thanks.

On Sat, May 5, 2018 at 7:13 AM, Måns Rullgård <mans@mansr.com> wrote:

> Shailendra Paliwal <beingshailendra@gmail.com> 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...
>
> --
> Måns Rullgård
>
> ------------------------------------------------------------
> ------------------
> 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
>

[-- Attachment #1.2: Type: text/html, Size: 2451 bytes --]

<div dir="ltr">Shailendra,<div><br></div><div>Glitching images seems like a cool idea and has me curious: what do you use this for? Are you hiding audio messages in images, as in steganography?</div><div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 5, 2018 at 7:13 AM, Måns Rullgård <span dir="ltr">&lt;<a href="mailto:mans@mansr.com" target="_blank">mans@mansr.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Shailendra Paliwal &lt;<a href="mailto:beingshailendra@gmail.com">beingshailendra@gmail.com</a>&gt; writes:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I found sox as a command-line equivalent of Audacity. I was wondering how<br>
&gt; can I glitch images like the way I can using Audacity.<br>
&gt;<br>
&gt; On audacity the usual modus operandi is,<br>
&gt;<br>
</span>&gt;    1. Use Audacity &gt; File &gt; Import &gt; Raw Data, to import a BMP image file.<br>
&gt;    2. Set the encoding to U-Law or A-Law.<br>
&gt;    3. Apply audio effects to the track.<br>
&gt;    4. Export Audio, set Save As Type &gt; Other Uncompressed Files<br>
&gt;    5. Header &gt; RAW (header-less) and Encoding &gt; whichever selected in (2)<br>
&gt;    6. Rename to BMP<br>
<span class="">&gt;<br>
&gt; I was wondering if the same method can be used with sox. That way I can<br>
&gt; make shell scripts to glitch images or even thousands of frames in a video.<br>
<br>
</span>Yes, this can be done.  Try something like this:<br>
<br>
$ sox -t ul -c 1 -r 48k input -t ul output effects...<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Måns Rullgård<br>
<br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world&#39;s most<br>
engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
______________________________<wbr>_________________<br>
Sox-users mailing list<br>
<a href="mailto:Sox-users@lists.sourceforge.net">Sox-users@lists.sourceforge.<wbr>net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/sox-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sox-users</a><br>
</font></span></blockquote></div><br></div>

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I use sox to glitch images?
  2018-05-05 11:13 ` Måns Rullgård
  2018-05-06 10:33   ` James Trammell
@ 2018-05-06 11:53   ` Shailendra Paliwal
  2018-05-06 15:40     ` Måns Rullgård
  1 sibling, 1 reply; 6+ messages in thread
From: Shailendra Paliwal @ 2018-05-06 11:53 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 1950 bytes --]

On Sat, May 5, 2018 at 4:43 PM, Måns Rullgård <mans@mansr.com> wrote:

> Shailendra Paliwal <beingshailendra@gmail.com> 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.

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

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

Now the files don't stitch back to the image either.


> --
> Måns Rullgård
>

[-- Attachment #1.2: Type: text/html, Size: 2810 bytes --]

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 5, 2018 at 4:43 PM, Måns Rullgård <span dir="ltr">&lt;<a href="mailto:mans@mansr.com" target="_blank">mans@mansr.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Shailendra Paliwal &lt;<a href="mailto:beingshailendra@gmail.com">beingshailendra@gmail.com</a>&gt; writes:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I found sox as a command-line equivalent of Audacity. I was wondering how<br>
&gt; can I glitch images like the way I can using Audacity.<br>
&gt;<br>
&gt; On audacity the usual modus operandi is,<br>
&gt;<br>
</span>&gt;    1. Use Audacity &gt; File &gt; Import &gt; Raw Data, to import a BMP image file.<br>
&gt;    2. Set the encoding to U-Law or A-Law.<br>
&gt;    3. Apply audio effects to the track.<br>
&gt;    4. Export Audio, set Save As Type &gt; Other Uncompressed Files<br>
&gt;    5. Header &gt; RAW (header-less) and Encoding &gt; whichever selected in (2)<br>
&gt;    6. Rename to BMP<br>
<span class="">&gt;<br>
&gt; I was wondering if the same method can be used with sox. That way I can<br>
&gt; make shell scripts to glitch images or even thousands of frames in a video.<br>
<br>
</span>Yes, this can be done.  Try something like this:<br>
<br>
$ sox -t ul -c 1 -r 48k input -t ul output effects...<br></blockquote><div>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.<br><br></div><div>So, I thought if I can split the header and the file contents into two file. That would be easy to run through sox.<br><br>I tried<br></div><div>$ sox -t ul -c 1 -r 48k water.bmp -t ul water_out trim 0 15 : newfile : restart<br></div><div><br></div><div>This should work because new headers aren&#39;t created while spitting and I checked this by merging these files back (I&#39;m on windows)<br></div><div>$ type water_out* &gt; water_databent.bmp<br><br></div><div>This get me the image again.<br></div><div><br>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<br></div><div>$ sox -t ul -c 1 -r 48k water_out002 -t ul water_out002 echo 0.8 0.7 45 0.31<br></div><div><br></div><div>Now the files don&#39;t stitch back to the image either. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Måns Rullgård<br>
</font></span></blockquote></div><br></div></div>

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I use sox to glitch images?
  2018-05-06 10:33   ` James Trammell
@ 2018-05-06 12:18     ` Shailendra Paliwal
  0 siblings, 0 replies; 6+ messages in thread
From: Shailendra Paliwal @ 2018-05-06 12:18 UTC (permalink / raw)
  To: James Trammell; +Cc: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 2528 bytes --]

On Sun, May 6, 2018 at 4:03 PM, James Trammell <james.trammell@gmail.com>
wrote:

> Shailendra,
>
> Glitching images seems like a cool idea and has me curious: what do you
> use this for? Are you hiding audio messages in images, as in steganography?
>
Hello James,

I don't have a use for it and so far it is only for recreation. Some of the
artists I follow use this technique sometimes to play with images. Some of
the music I like reminds me of the way Audacity bends images(I made short
clips with Ryoji Ikeda's soundtracks, [1]
<https://www.instagram.com/p/BgGp6DNgw0J/?taken-by=ziscore> and [2
<https://www.instagram.com/p/BgWONx3AFoA/?taken-by=ziscore>]) . I want to
explore analog video synthesizers but don't have the money to invest in a
setup right now so I thought I can explore digital ways for the idea.

Although steganography like that is also an inviting idea. I think an
esoteric mix of cryptography + machine learning + digital signal processing
tools would make for some really interesting work.

Best,
Shailendra


> Thanks.
>
> On Sat, May 5, 2018 at 7:13 AM, Måns Rullgård <mans@mansr.com> wrote:
>
>> Shailendra Paliwal <beingshailendra@gmail.com> 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...
>>
>> --
>> Måns Rullgård
>>
>> ------------------------------------------------------------
>> ------------------
>> 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
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 4046 bytes --]

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 6, 2018 at 4:03 PM, James Trammell <span dir="ltr">&lt;<a href="mailto:james.trammell@gmail.com" target="_blank">james.trammell@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Shailendra,<div><br></div><div>Glitching images seems like a cool idea and has me curious: what do you use this for? Are you hiding audio messages in images, as in steganography?</div></div></blockquote><div>Hello James,<br></div><div><br>I don&#39;t have a use for it and so far it is only for recreation. Some of the artists I follow use this technique sometimes to play with images. Some of the music I like reminds me of the way Audacity bends images(I made short clips with Ryoji Ikeda&#39;s soundtracks, <a href="https://www.instagram.com/p/BgGp6DNgw0J/?taken-by=ziscore">[1]</a> and [<a href="https://www.instagram.com/p/BgWONx3AFoA/?taken-by=ziscore">2</a>]) . I want to explore analog video synthesizers but don&#39;t have the money to invest in a setup right now so I thought I can explore digital ways for the idea. <br><br></div><div>Although steganography like that is also an inviting idea. I think an esoteric mix of cryptography + machine learning + digital signal processing tools would make for some really interesting work.<br><br></div><div>Best,<br></div><div>Shailendra<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, May 5, 2018 at 7:13 AM, Måns Rullgård <span dir="ltr">&lt;<a href="mailto:mans@mansr.com" target="_blank">mans@mansr.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><span>Shailendra Paliwal &lt;<a href="mailto:beingshailendra@gmail.com" target="_blank">beingshailendra@gmail.com</a>&gt; writes:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I found sox as a command-line equivalent of Audacity. I was wondering how<br>
&gt; can I glitch images like the way I can using Audacity.<br>
&gt;<br>
&gt; On audacity the usual modus operandi is,<br>
&gt;<br>
</span>&gt;    1. Use Audacity &gt; File &gt; Import &gt; Raw Data, to import a BMP image file.<br>
&gt;    2. Set the encoding to U-Law or A-Law.<br>
&gt;    3. Apply audio effects to the track.<br>
&gt;    4. Export Audio, set Save As Type &gt; Other Uncompressed Files<br>
&gt;    5. Header &gt; RAW (header-less) and Encoding &gt; whichever selected in (2)<br>
&gt;    6. Rename to BMP<br>
<span>&gt;<br>
&gt; I was wondering if the same method can be used with sox. That way I can<br>
&gt; make shell scripts to glitch images or even thousands of frames in a video.<br>
<br>
</span>Yes, this can be done.  Try something like this:<br>
<br>
$ sox -t ul -c 1 -r 48k input -t ul output effects...<br>
</div></div><span class="HOEnZb"><font color="#888888"><span class="m_-2749406930293774512HOEnZb"><font color="#888888"><br>
-- <br>
Måns Rullgård<br>
<br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world&#39;s most<br>
engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
______________________________<wbr>_________________<br>
Sox-users mailing list<br>
<a href="mailto:Sox-users@lists.sourceforge.net" target="_blank">Sox-users@lists.sourceforge.ne<wbr>t</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/sox-users" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sox-users</a><br>
</font></span></font></span></blockquote></div><br></div>
</blockquote></div><br></div></div>

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Can I use sox to glitch images?
  2018-05-06 11:53   ` Shailendra Paliwal
@ 2018-05-06 15:40     ` Måns Rullgård
  0 siblings, 0 replies; 6+ messages in thread
From: Måns Rullgård @ 2018-05-06 15:40 UTC (permalink / raw)
  To: Shailendra Paliwal; +Cc: sox-users

Shailendra Paliwal <beingshailendra@gmail.com> writes:

> On Sat, May 5, 2018 at 4:43 PM, Måns Rullgård <mans@mansr.com> wrote:
>
>> Shailendra Paliwal <beingshailendra@gmail.com> 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åns Rullgård

------------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 15:51 Can I use sox to glitch images? Shailendra Paliwal
2018-05-05 11:13 ` Måns Rullgård
2018-05-06 10:33   ` James Trammell
2018-05-06 12:18     ` Shailendra Paliwal
2018-05-06 11:53   ` Shailendra Paliwal
2018-05-06 15:40     ` Måns Rullgård

sox-users@lists.sourceforge.net unofficial mirror

Archives are clonable: git clone --mirror https://public-inbox.org/sox-users

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.sox
	nntp://news.gmane.org/gmane.comp.audio.sox

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox