I have a very specific set of needs and am looking for a library to fulfill them. Basically, I need to have audio play on a web page in a relatively quick manner. The catch here is that I do not want to allow the user to download the audio at all. So ideal behavior would be for my php script to generate the audio put it somewhere on my server, then serve html page. The location of the audio file would be given the audio player via a php variable. A cron job will go through some time period later and delete old generated audio. Is there any sort of good methods for doing this? I am fooling around with jPlayer, but was wondering if anybody else had any ideas for some solutions. The audio player is going to be completed obscured to user (aka zero width height div element) so the look of the player is irrelevant for my needs.
Things I considered:
1) Putting audio file in a non web-reachable location. This could not work however because then the audio player would not be able to access it from the client side either.
2) Have the audio in a web reachable location but make the code very hard to understand (obscure everything in the code) so that it would take a lot of work for user to actually find the location of the audio file in the html. A cron job would go through and delete old audio files within 5 minutes of creation anyway.
I hope this all makes sense, if anybody needs some clarification I would be happy to provide it. I just have never had to work with audio in a web page before in such a particular manner, so of course thank you for your help and time!
EDIT:
I know that is impossible to actually make it impossible for a client to access the audio. I just want to make it hard enough so general users will not be able to do it. To stop other people from abusing it, I suppose logging information would be necessary, so any idea on this would also be great.
Alright, so first off, you can forget about being able to obscure the audio in a way that nobody can get a copy of it. No matter what you do, you cannot prevent someone from capturing it client-side. Worst case scenario, tools such as Fiddler (or built into your browser) make this simple.
What I would do is serve your audio from a script, like you suggested, where the script requires the user to be logged in. Alternatively, just check for a session variable which you set on your page. The idea is to ensure that the user downloading this file is actually on your page. This way, you can also limit how many of these audio files the user is actually downloading. Pandora and others use similar methods.
The other thing you can do is use audio watermarking, so that if the audio file ends up out on the web somewhere, you can track it down to an individual user and go after them. Usually, you use an API from some company for this, but if you want to make your own, you’ll need some solid knowledge of DSP algorithms, so that the resulting audio file doesn’t contain a watermark that someone can detect with by ear.