Programming · TagLib#

Speakers, Ogg, and Flashing Realizations that I’m Wasting My Life

Speakers

This weekend, my chapter hosted the Western Regional Convention for Theta Tau. As we are a professional fraternity, we had a few speakers. One talked about some fascinating molecules which are liquid at room temperature and solidify at body temperature (counter-intuitive, huh?) and the other discussed what ABET says an engineer should be, what’s wrong with ASU’s current direction for engineering, and the most important thing an engineer should do with his life: Get a PhD in public policy and become a legislator. Needless to say, the talk was incredibly mind blowing and inspirational, not to mention dead on. As engineers, it is our life’s work to build, to invent, to improve. The weakest link in the betterment of mankind is those who say what we can and cannot do… Mainly because they cannot or do not know what we can and cannot do. We need rational, analytical, and just plain logical people making decisions.

On Monday, I found a insert in my New York Times advertising the launch of the School of Earth and Space Exploration (because “school of geology and astronomy” sounds lame) at ASU, and attended the some really interesting lectures by science writers. Science writing is a huge challenge because it is taking some of the greatest and most profound ideas and discoveries, then simplifying and clarifying it so that everyone can understand it. I feel the two lectures go hand in hand. We must be both effective thinkers and effective speakers if we are going to move the world forward. Profound thoughts are meaningless if the mouth and the pen cannot convey them to the audience.

Ogg

OGG is a great protocol for streaming. Really top of the line. Its like an MPEG stream but without the codec limitations. That said, OGG is a thorn in my side. As it is currently written, TagLib# has a TagLib.Ogg.File and a TagLib.Ogg.Vorbis.File, the former featuring File.GetPacket(int) which parses the stream (assumed singular) for packets, and the latter featuring File.Read() which gets the metadata from packet[0] and the comment from packet[1]. (I do not yet understand how writing works.)

So, I decided to abolish TagLib.Ogg.Vorbis.File and TagLib.Ogg.Flac.File in place of TagLib.Ogg.File + TagLib.Ogg.Codecs.Vorbis, etc. This will be helpful when I have multi-streamed files, like Vorbis + Theora. That being said, I’ve come up with this little diagram of how to read a stream:

-> Read Page
   -> Send Page to Bitstream Parser
      -> If BOS:
         -> Get Codec
         -> Add stream to "working streams"
      -> Send Page to Codec
      -> Returns false if more info needed.
   -> If not all streams return "true" (there are "working streams", Read Page

After that, I should know everything except the duration. For that, I have to read the last page of the stream, figure out which bitstream it belongs to, then use (last_granular_position – first_granular_position) / codec_encoding_specific_context.

-> File.RFind ("OggS")
-> Codec.GetDuration (GetPageHeader().last_granular_position)

Overall, it’s not that bad. But unlike the other big two containers (MPEG-4 and ASF), I have to worry about the codec, as there is no general “Media Properties” block, and I have to seek to the end of the file and do a backward search for a value. OGG, MPEG-4, and ASF SHOULD NOT be categorized together two are boxed formats and one is just a method for multiplexing data streams.

Flashing Realizations that I’m Wasting My Life

These are always the worst when they strike. I had one of those recently and changed my major from the loathsome Chemical Engineering to Computer Systems Engineering. I’ve had my reservations about CSE, but truth be told, I hate reactor design, I hate separations, and I do not want to watch valves. Well, as I was sitting around trying to piece together my financial situation for the remainder of my schooling, I realized that I’m a mess. As such I started cleaning my room and doing my much overdue laundry. But what I really need to do is start making money. If I am going to survive the fall and spring semesters, I will need to devote almost all my time to my coursework, and as such will not be working. As such, I estimate that I will need $6707.50 and a serious change in behavior before summer ends. Even with Summer of Code (God willing), I’ll need to work my tail off until June 1st to make everything work out. And stop spending. Alas.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s