acoustic-marks in audio-file

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

acoustic-marks in audio-file

Rainer M. Engel
Hello everyone,

I'm new to SoX and although I don't know why I read this type of opening
sentence so often in other lists, I'd simply like to ask a certain question.

I want to create a soundfile in which I hear at certain time positions a
very short peep-sound. This file should be mixed over the audio track of
a movie to mark some positions in an acoustic manner.

Layout:
|-silent----------------|peep|-silent------------| ....
 mixed with..
|-original-audio---------------------------------| ....


What would be the best way to achieve this?

Given is a wav-file 48KHz Stereo of ~2hours length and there would be a
few or several hundred peep marks to make.

First Approach:
Opening original audio file and mix peep at certain positions. How could
this be done incremental or in one step?
Is it possible to create a reference level tone as beep?


Second Approach:
1. create all silent fragments in their desired length
2. create peep-wave segment (perhaps: reference level tone)
3. concatenate these fragments: silent1+peep+silent2+peep ...
4. mix this wav with a matching length over original wave



Any thoughts, help appreciated.

Best Regards,
Rainer




------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Ulrich Klauer-2
"Rainer M. Engel" <[hidden email]>:

> I want to create a soundfile in which I hear at certain time positions a
> very short peep-sound. This file should be mixed over the audio track of
> a movie to mark some positions in an acoustic manner.
>
> Layout:
> |-silent----------------|peep|-silent------------| ....
>  mixed with..
> |-original-audio---------------------------------| ....
>
>
> What would be the best way to achieve this?
>
> Given is a wav-file 48KHz Stereo of ~2hours length and there would be a
> few or several hundred peep marks to make.

The mixing can be done with
   sox -M input.wav beeps-and-silence.wav output.wav remix -m 1,3 2,3

The easiest way to place the beeps is probably to replicate them into  
as many channels as you'll need beeps, then move them with "delay",  
like this:
   sox beep.wav beeps-and-silence.wav remix 1 1 1 1 1 1 1 ... 1 delay  
2:17 3:51 47:11 ... 1:58:22 remix -m -
However, this is not very efficient (for a large number of beeps)  
because of the many temporary channels. It may also need increasing  
the buffer size.

A more efficient approach would be to use repeat and pad, operating on  
only one channel. However, the beep positions would need some  
preprocessing.

> 1. create all silent fragments in their desired length
> 2. create peep-wave segment (perhaps: reference level tone)
> 3. concatenate these fragments: silent1+peep+silent2+peep ...

This is also possible. You'd need to preprocess the positions here,  
too, however, and you'd have many temporary files.

Ulrich


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Fmiser
> Ulrich Klauer wrote:

> "Rainer M. Engel" <[hidden email]>:
>
> > I want to create a soundfile in which I hear at certain time
> > positions a very short peep-sound. This file should be mixed
> > over the audio track of a movie to mark some positions in an
> > acoustic manner.
> >
> > Layout:
> > |-silent----------------|peep|-silent------------| ....
> >  mixed with..
> > |-original-audio---------------------------------| ....
> >
> >
> > What would be the best way to achieve this?
> >
> > Given is a wav-file 48KHz Stereo of ~2hours length and there
> > would be a few or several hundred peep marks to make.
>
> The mixing can be done with
>    sox -M input.wav beeps-and-silence.wav output.wav remix -m
> 1,3 2,3
>
> The easiest way to place the beeps is probably to replicate
> them into as many channels as you'll need beeps, then move
> them with "delay", like this:
>    sox beep.wav beeps-and-silence.wav remix 1 1 1 1 1 1 1 ...
> 1 delay 2:17 3:51 47:11 ... 1:58:22 remix -m -

What about making a silence+peep-at-the-end file that has
exactly the correct amount of silence.  Then copy this
end-to-end to make a track that is more than plenty long.  This
could even be saved for future use.  Then mix it with the
soundtrack.

Or is it possible to do this within Sox?  Mix sountrack.wav and
silence+peep.wav, repeating silence+peep.wav end-to-end?

--   Philip

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rob Sykes
Not sure how suitable in this case, but worth mentioning: a couple of examples of adding audio markers can be found here:
  http://sox.git.sourceforge.net/git/gitweb.cgi?p=sox/sox;a=blob;f=scripts/testtones.sh

(search for 'mark').

Cheers,
Rob

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Ulrich Klauer-2
In reply to this post by Fmiser
Fmiser <[hidden email]>:

> What about making a silence+peep-at-the-end file that has
> exactly the correct amount of silence.  Then copy this
> end-to-end to make a track that is more than plenty long.  This
> could even be saved for future use.  Then mix it with the
> soundtrack.

> Or is it possible to do this within Sox?  Mix sountrack.wav and
> silence+peep.wav, repeating silence+peep.wav end-to-end?

Not in one pass. You can create the repeating track (with the "repeat"  
effect) separately though, then mix it with the original sound in a  
second step.

However, as I understand the task (I may be wrong), it is not about a  
regular beeping (say, every 10 seconds), but about adding beeps at  
certain non-regular positions.

Ulrich


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rainer M. Engel
Am 13.01.2013 12:35, schrieb Ulrich Klauer:
> However, as I understand the task (I may be wrong), it is not about a  
> regular beeping (say, every 10 seconds), but about adding beeps at  
> certain non-regular positions.

That is correct. It would make sense for review purposes to have scene
cuts marked with this method rather than with an optical mark, which
could divert from more important visual aspects of a movie.
Working with lots of temporal files wouldn't be too bad.

Right now I have to get familiar with sox in general. So thank you all
for your kind help and example command lines.

sox input.wav output.wav [effect[effect-options]] for doing effects
stuff is clear so far. Concatenating and mixing is easy to figure out too.

I read about channels and rate (-c 2 -r 48000) but I do not know how to
create a wav file of a given length with empty channels. I'm afraid that
is simpler than with logic to solve ;-|

Thank you very much.

Best Regards,
Rainer

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Ulrich Klauer-2
Rainer M. Engel <[hidden email]>:

> I read about channels and rate (-c 2 -r 48000) but I do not know how to
> create a wav file of a given length with empty channels.

There is a special file "-n" that contains infinite silence on read  
(anything written to it will be discarded). You can use the "trim"  
effect to only get part of this infinity. Thus,
   sox -c 2 -r 48000 -n silence.wav trim 0 5:00
will give you five minutes of silence, in stereo.

Ulrich


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rainer M. Engel
In reply to this post by Rob Sykes
Am 12.01.2013 10:16, schrieb Rob Sykes:
> Not sure how suitable in this case, but worth mentioning: a couple of examples of adding audio markers can be found here:
>   http://sox.git.sourceforge.net/git/gitweb.cgi?p=sox/sox;a=blob;f=scripts/testtones.sh
>

Thank you Rob for pointing to that shell script. That is nice to have
and it supports any taste I'd guess.. :)

Best Regards,
Rainer

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rainer M. Engel
In reply to this post by Ulrich Klauer-2
Thank you very much Ulrich.

With this information I'll proceed successful.

I made a concatenation test and it worked to up to 500 files. Not beyond.

Perhaps something like this..
sox -cat ascending file_%04d.wav new-wave.wav

..would be nice to concat all files matching that filter to one outputfile.

But hey.. I'm very glad for the given input here and I think I'll use
SoX from now on..

Best Regards,
Rainer












------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Ulrich Klauer-2
Rainer M. Engel <[hidden email]>:

> I made a concatenation test and it worked to up to 500 files. Not beyond.

There is often a restriction on the length of a command line. SoX  
itself should not be limiting the number of files.

You can avoid the shell in at least two ways:

1. Use a playlist file. Make a file "list.m3u" that contains all the  
file names, each on a separate line, then run
   sox list.m3u output.wav effects ...
or similar.
2. Use internal globbing:
   sox "file_*.wav" output.wav
Note the quotes around the first argument, they tell the shell not to  
replace this with a list of matching file names (instead, SoX will do  
this internally).

> Perhaps something like this..
> sox -cat ascending file_%04d.wav new-wave.wav
> ..would be nice to concat all files matching that filter to one outputfile.

Actually, globbing (both shell and internal) will do that. The files  
are ordered lexicographically; i.e., as long as numbers are  
zero-padded (file09, file10; not file9, file10), you can just write  
file_*.wav or "file_*.wav" as above.

Ulrich


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rainer M. Engel
Hello Ulrich,

I tested your advice and had difficulties with 1000 files (each 1sec).

sox.exe FAIL formats: can't open input file `..490.wav`: Too many open files

I attached a compressed container with these 1000 and m3u files.
https://dl.dropbox.com/u/414433/SoX/sox_m3u-concat.7z (uncompr. 360MB!)

------------------------------------------------------------
sox.exe Q:\sox\combine_0480.m3u Q:\sox\combine_0480.wav
sox.exe Q:\sox\combine_0500.m3u Q:\sox\combine_0500.wav
sox.exe Q:\sox\combine_1000.m3u Q:\sox\combine_1000.wav

sox.exe "Q:\sox\silence_*.wav" Q:\sox\combine_1000.wav
------------------------------------------------------------

>From above lines only the first one works here.
I use sox 14.4.0 (on WIN32).

Is it a caching issue? Because ..

sox.exe Q:\sox\combine_0480.wav Q:\sox\combine_0480.wav
Q:\sox\combine_0960.wav

and

sox.exe Q:\sox\combine_0960.wav Q:\sox\combine_0960.wav
Q:\sox\combine_1920.wav

work just fine in the same environment.
But I can work around this issue for my application and I only wanted to
give feedback.

Best Regards,
Rainer





Am 14.01.2013 02:02, schrieb Ulrich Klauer:

> Rainer M. Engel <[hidden email]>:
>
>> I made a concatenation test and it worked to up to 500 files. Not beyond.
>
> There is often a restriction on the length of a command line. SoX  
> itself should not be limiting the number of files.
>
> You can avoid the shell in at least two ways:
>
> 1. Use a playlist file. Make a file "list.m3u" that contains all the  
> file names, each on a separate line, then run
>    sox list.m3u output.wav effects ...
> or similar.
> 2. Use internal globbing:
>    sox "file_*.wav" output.wav
> Note the quotes around the first argument, they tell the shell not to  
> replace this with a list of matching file names (instead, SoX will do  
> this internally).
>
>> Perhaps something like this..
>> sox -cat ascending file_%04d.wav new-wave.wav
>> ..would be nice to concat all files matching that filter to one outputfile.
>
> Actually, globbing (both shell and internal) will do that. The files  
> are ordered lexicographically; i.e., as long as numbers are  
> zero-padded (file09, file10; not file9, file10), you can just write  
> file_*.wav or "file_*.wav" as above.
>
> Ulrich
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Jan Stary
In reply to this post by Rainer M. Engel
On Jan 13 15:02:04, [hidden email] wrote:
> Am 13.01.2013 12:35, schrieb Ulrich Klauer:
> > However, as I understand the task (I may be wrong), it is not about a  
> > regular beeping (say, every 10 seconds), but about adding beeps at  
> > certain non-regular positions.
>
> That is correct. It would make sense for review purposes to have scene
> cuts marked with this method rather than with an optical mark, which
> could divert from more important visual aspects of a movie.

Ha, "scene cuts", I thought as much!

IMHO you are much better off with some other tools.
Creating an audio track for this (either with sox or anything else)
means saving 2 hours of basically silence into a file. That's just absurd.

If these are supposed to be cue points in a movie,
get some movie-cutting software that has this functionality.
Typically, you would create a MIDI track containing those
"cue points" - which is a defined MIDI event, invented
precisely for this.

        Jan



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: acoustic-marks in audio-file

Rainer M. Engel
Am 23.01.2013 16:37, schrieb Jan Stary:
> If these are supposed to be cue points in a movie,
> get some movie-cutting software that has this functionality.
> Typically, you would create a MIDI track containing those
> "cue points" - which is a defined MIDI event, invented
> precisely for this.

Hey Jan,

thank you for your tip. MIDI was also one of my first thoughts but the
overall aim is/was to be able doing it without GUI based tools in one
simple to automate manner. I'll have to see if these or other approaches
work appropriate under real circumstances.

Best regards,
Rainer

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users