PDA

View Full Version : extract SMPTE time code programmaticaly


newsgroups.comcast.net
06-23-2006, 07:25 PM
Could anybody point me to some sample code that shows how to extract the
SMPTE time code from an audio stream. I have read through Phil Rees's
article and done an extensive search but I still could use some help on
this.

John

robert bristow-johnson
06-23-2006, 07:38 PM
in article [email protected],
newsgroups.comcast.net at johnbe2 at hotmail dot com wrote on 06/23/2006
14:25:

> Could anybody point me to some sample code that shows how to extract the
> SMPTE time code from an audio stream.

you mean how to get it out of the AES/EBU or S/PDIF bits? or is the SMPTE
embedded somehow differently? or is it a different digital format?


--

r b-j [email protected]

"Imagination is more important than knowledge."

newsgroups.comcast.net
06-23-2006, 08:08 PM
I am listening to the audio stream on the "line in" via Java's
AudioInputStream (numBytes = inputStream.read(byteArray);)

how do I extract the time code out of these sequence of bytes? I am not sure
if this is possible w/o special hardware.

John


"robert bristow-johnson" <[email protected]> wrote in message
news:C0C1AD66.15D2E%[email protected]...
> in article [email protected],
> newsgroups.comcast.net at johnbe2 at hotmail dot com wrote on 06/23/2006
> 14:25:
>
>> Could anybody point me to some sample code that shows how to extract the
>> SMPTE time code from an audio stream.
>
> you mean how to get it out of the AES/EBU or S/PDIF bits? or is the SMPTE
> embedded somehow differently? or is it a different digital format?
>
>
> --
>
> r b-j [email protected]
>
> "Imagination is more important than knowledge."
>
>

Erik de Castro Lopo
06-24-2006, 12:34 AM
"newsgroups.comcast.net" wrote:
>
> I am listening to the audio stream on the "line in" via Java's
> AudioInputStream (numBytes = inputStream.read(byteArray);)
>
> how do I extract the time code out of these sequence of bytes? I am not sure
> if this is possible w/o special hardware.


I designed hardware to do this for a company I once worked
for, but its definitely possible in software as well.

Basically you'll need to find all the transitions, measure
the distance between them in samples. Once you have this
you need to find the sync word and then read off the bits.

The vast majority of the information you need is available
here:

http://en.wikipedia.org/wiki/Linear_timecode

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"Hey, I've re-dorkulated." -- Prof. Frink (The Simpsons)

Jon Harris
06-27-2006, 08:00 AM
"Erik de Castro Lopo" <[email protected]> wrote in message
news:[email protected]...
> "newsgroups.comcast.net" wrote:
>>
>> I am listening to the audio stream on the "line in" via Java's
>> AudioInputStream (numBytes = inputStream.read(byteArray);)
>>
>> how do I extract the time code out of these sequence of bytes? I am not sure
>> if this is possible w/o special hardware.
>
>
> I designed hardware to do this for a company I once worked
> for, but its definitely possible in software as well.
>
> Basically you'll need to find all the transitions, measure
> the distance between them in samples. Once you have this
> you need to find the sync word and then read off the bits.
>
> The vast majority of the information you need is available
> here:
>
> http://en.wikipedia.org/wiki/Linear_timecode

If you know the (approximate) rate of the timecode, then it is pretty simple.
You can count a fixed number of samples from each transition to see if another
transition is taking place. If the timecode is coming from an analog recorder
with varispeed so it can be more than half or twice the nominal rate, it becomes
a bit trickier.

Jon Harris
06-27-2006, 08:04 AM
P.S. A Google search turns up a lot of good hits, including this very complete
one:
http://www.philrees.co.uk/articles/timecode.htm

--
Jon Harris
SPAM blocker in place:
Remove 99 (but leave 7) to reply

"Jon Harris" <[email protected]> wrote in message
news:II4og.26934$Xn.25874@trnddc05...
> "Erik de Castro Lopo" <[email protected]> wrote in message
> news:[email protected]...
>> "newsgroups.comcast.net" wrote:
>>>
>>> I am listening to the audio stream on the "line in" via Java's
>>> AudioInputStream (numBytes = inputStream.read(byteArray);)
>>>
>>> how do I extract the time code out of these sequence of bytes? I am not sure
>>> if this is possible w/o special hardware.
>>
>>
>> I designed hardware to do this for a company I once worked
>> for, but its definitely possible in software as well.
>>
>> Basically you'll need to find all the transitions, measure
>> the distance between them in samples. Once you have this
>> you need to find the sync word and then read off the bits.
>>
>> The vast majority of the information you need is available
>> here:
>>
>> http://en.wikipedia.org/wiki/Linear_timecode
>
> If you know the (approximate) rate of the timecode, then it is pretty simple.
> You can count a fixed number of samples from each transition to see if another
> transition is taking place. If the timecode is coming from an analog recorder
> with varispeed so it can be more than half or twice the nominal rate, it
> becomes a bit trickier.
>

Erik de Castro Lopo
06-27-2006, 08:40 AM
Jon Harris wrote:

> If you know the (approximate) rate of the timecode, then it is pretty simple.
> You can count a fixed number of samples from each transition to see if another
> transition is taking place.

My hardware LTC decoder did 1/10th speed to 5 times speed :-).


Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
'Unix beats Windows' - says Microsoft!
http://blogs.zdnet.com/Murphy/index.php?p=459