Reinventing the Wheel: A Better Media Player

Posted: November 22nd, 2009 | Author: | Filed under: Music, Software | Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , | No Comments »

As I’ve posted in the past, I am a picky media player user. I’ve tried most every free player under the sun, along with some not so free solutions and have yet to be entirely satisfied with any of the available products. To that end, I’ve started to think about the possibility of writing my own media player. The following are some of the considerations that I’ve been mulling over:

Base Requirements:

  • Playback of both mp3 and flac files. Support for other formats could be added as required by me or other users, possibly with us of some sort of plugin engine.
  • Some kind of a rating system, preferably with a high level of granularity. I’m not married to the standard 5-stars idea, and may explore alternative ideas, including tagging.
  • Truly smart playlists that allow for the standard global AND/OR rules, as well as more advanced expressions that support brackets and branching logic.
  • Smart importing from existing iTunes, Songbird, Media Monkey, and Windows Media Player libraries, various playlist formats, and other types of media collections.

Feature Wish List:

  • Blackberry Sync: When not at home, I listen to music from a flash card on my Blackberry Curve. The device can be filled with media by simply dumping it all on the media card, which appears as a removable drive. As previously mentioned, I listen to a mix of mp3 files and lossless flac files. When dumping these files to the Blackberry, I would like to see one thread dedicated to converting the flac files to mp3s, while another thread actually fills the device, resulting in a sync process that is not significantly slowed by media conversions. Additionally, since I have hard drive space to spare, I would like to cache some or all of the resulting mp3 files so that they don’t have to be converted again on the next sync. I would also like to see the ability to import files from the Blackberry to the library so that I could pick up media on the go and bring it home with me.
  • Library Export/Backup: With a library of 10K+ tagged and rated songs, losing the library of meta data about my music would be a traumatic experience indeed. To solve my paranoia over losing this data, I would like to implement the export of single playlists and entire libraries to all of the major playlist formats, as well as to a structured XML document, similar to the one that iTunes maintains. Some kind of automated backup feature like the one that iTunes has would also be nice.
  • Online Integration: I currently report all of my song plays to last.fm, which is an excellent resource for discovering new music. I would like my media player to link in with last.fm and other online resources, but am also open to developing my own online resource that lets users to easily compare and organize their collections, correct their meta data, and actively discover new music that other users have rated.
  • Library Sharing/Streaming: We run a large network with lots of computers, and I’d like the ability to listen to my music from anywhere in the house. I really like the work that Subsonic has done in this area, and hope to implement some or all of it’s features, while at the same time linking it into my database so that I can see my playlists and edit my meta data from anywhere in the house, and indeed, from anywhere in the world.
  • Cross-Platform and Open-Sourced: Given all of my recent experience with Debian Linux, I’d like to see my media platform running on both Windows and Linux. This one might take me awhile to accomplish, but is definitely a goal of mine, given that I am now a confirmed Linux user who still keeps a couple of Windows platforms lying around.

Implementation:

Of course, with all of these goals in mind, the next step is to consider which platform I’d like to build on. This basically comes down to a number of choices, some cross-platform, some not:

  • Visual Studio .NET: My development IDE of choice, Visual Studio provides extremely quick GUI creation and a great number of useful libraries that cut out a lot of the nitty gritty time consuming base code necessary for a project as large as a media player. Additionally, the Windows Media Player control allows for drop-in playback of media, and I have a ton of example code lying around that implements most of the features listed above. Unfortunately, while .NET 2.0 is supported on Linux under the Mono platform, I don’t know how far that support goes in terms of media management and playback.
  • SFML: The Simple Fast Media Library is available as libraries that are pre-compiled to run on Windows, Linux, and Mac, with support for Visual Studio, C/C++, Python, and Ruby. It includes packages for windowing, graphics, networking, and most importantly, audio capture and playback. This is a definite contender as it is open source, meaning that I could build the libraries directly into my code, and simply recompile for different platforms. Of course, the downside is that I’ll have to code in C++, and without any kind of graphical interface builder.
  • Juce: Jules Utility Class Extensions is like a more featured version of SFML that provides packages for just about every conceivable task, including some serious audio libraries that support all kinds of playback, effects, and hardware accelerated features. In addition, it does audio CD reading and writing out of the box on Mac and PC platforms. If I were to strike out from Visual Studio, this would probably be my library of choice, as it can do nearly everything that VS can do, but is fully open sourced and supported on just about every available platform.
  • Java: I have no idea how realistic this idea is. I do know that in the past, I’ve created Java apps that can play both wav and mp3 files, and stream those files over a network connection. That said, as much as I enjoy coding in Java, it is widely regarded as being slow and clunky – not exactly traits that I’d like associated with a media player that will be running all day. On the other hand, Java is not C/C++ (a huge bonus as far as I’m concerned), is fully object oriented, has decent audio support, and makes networking extremely easy. That said, programming GUI’s of any kind of complexity in Java is not a task to be taken on lightly.

Well, that about sums it up. This project is definitely something that I intend to undertake in the coming months, and until then, I’ll keep thinking about my requirements and what library I’d like to use to implement it. If anybody else has experience with some useful audio libraries that they’d like to share, please do so in the comments.


OpenGL in VisualStudio.Net with the TAO Framework

Posted: March 4th, 2009 | Author: | Filed under: Software | Tags: , , , , , , , , , , | 1 Comment »

Some who read me on a regular basis might be wondering what ever happened to the RPG I was writing in VisualStudio using Microsoft’s XNA technology. Truth is, it never went anywhere. Like a lot of past projects, I got very psyched about it, wrote a bunch of code, and then school started and I got way too busy to finish it. I haven’t touched the code since I wrote that post, but now I’ve got some new ideas.

Last term in school, I took an excellent course on OpenGL programming with C++. The course covered how to create and render 3D graphics, with study lent to topics such as window management, points, vertices, and polygons, lighting and shading, hidden surface removal, and texturing. My earlier post about the MAX 3D Engine was a byproduct of that course.

Since then, I’ve discovered a managed .NET wrapper around the OpenGL libraries called the Tao Framework that allows you to (in theory) code any graphics application in Visual Basic or C# that you could in C++, with the added bonus of the pretty IDE, code completion, top of the line window handling procedures, and the .NET libraries. Now at this point, if you’re a graphics programmer, you’re laughing aloud at my outrageous claim – managed, run-time interpreted code could never be fast enough to run a video game! You may be correct. Frankly, I have no idea, as I haven’t yet had the time to write a full video game.

What I have come up with however, are two starter projects for anybody wishing to try their hand at OpenGL programming using Tao and Visual Basic.NET. The code in both is well documented, easy to follow (especially if you are familiar with standard OpenGL routines), and seems to run at a reasonable 60fps. Now, I can’t tell until I add a few more polygons to the scene whether this framerate is an artificial limit applied by the environment, or if interpreted code actually has no hope of ever running a game at a reasonable speed. That is an experiment for a later day. For now, I will simply share these starter projects for all to use. If you do something with them, please leave a comment and let me know how it went.

Tao2D Test Harness:

A simple application that spins a tri-coloured, smooth-shaded triangle around the y-axis.

Source Code: Tao2D Source VB.Net.zip

MD5 Hash: 4DA0FC584B1EF8738B3B9CA4C1F55388

Binaries: Tao2D Binary.zip

MD5 Hash: 611382CB00CADD860A81A85573CBA763

Tao3D Test Harness:

A simple application that spins a really crappy looking cone around the x-axis

Source Code: Tao3D Source VB.NET.zip

MD5 Hash: 8D54DB42109F12C745AD14922FF8850E

Binaries: Tao3D Binaries.zip

MD5 Hash: 5D4CD4D02B3EE1194758A543DF36C034

As always, I recommend using Tyler Burton’s Hash Verifier program to verify the integrity of these downloads.