5

I noticed that companies such as iTunes and Amazon add "watermarks" to their mp3 files showing information such as the following:

  • From where the file was purchased.
  • Who purchased it.
  • etc.

Amazon also states that

"Some record companies require us to insert identifiers in the metadata that accompanies music"

The e-commerce website that I'm busy developing is going to sell mp3 downloads. Since iTunes and Amazon are forced to add watermarks to their songs, some record companies will most probably require the one I'm developing to do the same.

The website is a web application developed using ASP.NET 4 and C#. It seems impractical to generate a new file with the metadata modifications on our web servers for each user who downloads a mp3, because that will cause thousands of temporary mp3 files to reside on our servers.

Is there any way to inject the relevant metadata into the file as it gets downloaded, or possibly on the client-side with HTML5?

hakre
  • 193,403
  • 52
  • 435
  • 836
Curious Coder
  • 177
  • 1
  • 11
  • 4
    To watermark a file on the client side sounds like a really bad idea. The user could just remove the code that adds the watermark and have an unmarked file. – magnattic Mar 18 '13 at 15:31
  • 1
    Is it not just using [ID3 tags](http://en.wikipedia.org/wiki/ID3)? Just because it's a bad idea technically doesn't mean record companies wouldn't be demanding it... – robertc Mar 18 '13 at 17:42
  • 1
    I agree, but users can download tools to remove the metadata from their files anyway... Do you have any recommendations? – Curious Coder Mar 18 '13 at 19:09

1 Answers1

3

You do not need to create thousands of files on the server. You can read from the source, stream it through some method of inserting a watermark, and then output to a new mp3 stream directly to the http response.

This library provides a lot of useful classes for reading and writing mp3 streams and other audio manipulations.

http://naudio.codeplex.com/

It does not have watermarking built in. You'll need to do that. That is going to be the really complicated part. You need to modify the original file in a way that you can recognize the watermark data, but not affect the audio quality and not be able to remove easily. Good luck.

Samuel Neff
  • 73,278
  • 17
  • 138
  • 182