[Webinar] Learn how to a build a cloud-first strategyRegister Now


A custom mp3 player

Posted on 2009-12-27
Medium Priority
Last Modified: 2013-11-13
I want to create an simple mp3 player, but I want the files not to be mp3, to be converted some how to another format (not known) that only this player will play.

I just want my audio files not to be able to be played from other players.

How can I do it?

Can it been done using a simple file encryption/decryption?

I d prefer c# solution or something familiar.
Question by:icecbr
  • 5
  • 3
LVL 19

Expert Comment

ID: 26129844
How secure does this have to be / how much time are you willing to put in?

Author Comment

ID: 26130196
The player will be used for simple use, just to play some playlists, with classic features such as crossfading the songs and shuffling them.

The "converter" will be a seperate program of course...

I prefer to be very secure. Time is not a problem, I have 1-2 months and maybe more...

LVL 19

Expert Comment

ID: 26130203
I'd suggest you simply encrypt normal mp3's.
You will probably spend the most time in decoding only little pieces in memory at a time and decoding these pieces, instead of the whole mp3 at once (insecure).
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 26133189
could you give me more info plz?
LVL 19

Expert Comment

ID: 26136301
Do you have previous experience with processing and playing audio?
he whole thing is too big to just get a working solution to everything, so you'll have to break it down a little into smaller parts. What part is it you don't understand?

Author Comment

ID: 26137284
No I dont have such experiense, I d say I have general programmin experiense, you r right, lets start from the beggining...

Firstly I am a little confused about what to use, I took a look at codeproject and found some mp3 players...
There are some ways to do it, like using winmm.dll directx and others...
Which are best for low cpu usage, seeking and of course I need crossfading?

Which is a good method for crossfading? get length of playing file and 10sec before it ends start playing the next file?

If for start I make a player just playing the mp3 of a folder and crossfading them its half my work, then I ll just add more playlists, shuffle etc...

and finaly I think that a method like this: http://www.codeproject.com/KB/security/fileencryptdecrypt.aspx can achive the encoding issue....

thank you
LVL 19

Accepted Solution

MerijnB earned 2000 total points
ID: 26137531
I must say that it might be a little bit over your head in 2 months, but I can't really tell how much 'general programming' experience you have.

Like said before, the question as a whole is too big to answer. I'll try to make smaller parts which you should dig into. If you have questions about those parts, ask a question here. But you should really try to do the big 'whole' thing yourself.

A little info: things like crossfading and seeking is something you want to do on uncompressed audio (PCM wave), not mp3 (or any other format you are going to use).

So the chunks are more or less:

- Pick a compressed audio format you are going to use. Look for something you can uncompress from code (in small parts, not as a whole!).

- Find a way to feed this audio to your soundcard. I don't know how this should be done (properly) in .NET, but with for example c++ one would use the API's WaveOutReset, WaveOutOpen, WaveOutClose, WaveOutPrepareHeader, WaveOutUnprepareHeader, WaveOutWrite, etc. If you want to do things like crossfade, you must be able to manipulate the audio at the sample.

- Play around with the PCM waves, try things like crossfading, etc.

- Pick a encryption / decryption algorithm. I don't think it will differ much which one it is. Keep in mind that you must be able to encrypt the source files in such a way that you can decrypt small blocks, instead of the whole file only, this is to keep things more secure (don't keep the whole song uncompressed in memory).

- Combine all above steps ;)

Hope you're not overwhelmed!
LVL 19

Expert Comment

ID: 26137547
Oh, on crossfading.

Crossfading consists out of two parts:

1) Being able to fade in and fade out (simple a matter of doing a multiplication on the samples).
2) Being able to mix two different audio signals (simple a matter of adding up the samples).

Keep in mind (for the fading) that the dB scale is logarithmic and not linear.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
It is a real story and is one of my scariest tech experiences. Most users think that IT experts like us know how to fix all computer problems. However, if there is a time constraint and you MUST not fail the task or you will lose your job, a simple …
Viewers will learn how to create burn videos onto a DVD using Nero Suite including creating a DVD menu and chapters.
Viewers will learn how to use Macros for greater control over Rack parameters in Ableton Live. Group devices into a Rack by selecting them and pressing Command-G (Ctrl-G on PC): Control-click (Right Click on PC) a parameter to access pop-up menu, …
Suggested Courses
Course of the Month20 days, 10 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question