Heya, i am creating a personal site using Microsoft Frontpage. To make the site more intersting i have added music .. But i know if i allow people to download it from my site it will be illegal. Can anyone help me and tell me how to make the music unavailable to download and to listen to ONLY?.

Thanks,
Killswitch.

Dani AI

Generated

Short version for and anyone else reading years later: what you want (play audio in a browser but make it impossible to save) cannot be guaranteed. As and pointed out, a browser must receive the audio bytes to play them, so a determined user can capture or copy those bytes. Suggestions such as simple JavaScript or embedded players (as suggested by and discussed by ) only stop casual users — they do not stop someone who knows where to look.

Practical options that make casual copying harder (ordered from easiest to most complex):

  • Don’t expose direct file URLs in your HTML; never put the real filename in a public <a>.
  • Serve audio through a server-side script that checks authentication and uses short-lived signed URLs (tokens). This prevents bookmarked direct links from being reusable.
  • Use segmented streaming (HLS/DASH) with tokenized keys or time-limited manifests — it raises the bar for casual downloaders.
  • For real access control use licensed DRM systems (Widevine/PlayReady/FairPlay) — effective but complex and expensive for a personal site.
    Also remember ’ UX point: avoid autoplay — let visitors choose to listen.

Example (conceptual) — create short-lived signed URLs and validate them server-side:

// generate link (server-side)
$secret = 'CHANGE_THIS_TO_A_LONG_RANDOM_VALUE';
$file = 'song.mp3';
$expires = time() + 300; // 5 minutes
$sig = hash_hmac('sha256', $file . '|' . $expires, $secret);
$url = "/serve.php?file=" . urlencode($file) . "&expires=$expires&sig=$sig";
// serve.php: validate and stream
$secret = 'CHANGE_THIS_TO_A_LONG_RANDOM_VALUE';
$file = $_GET['file'] ?? '';
$expires = intval($_GET['expires'] ?? 0);
$sig = $_GET['sig'] ?? '';
if ($expires < time() || $sig !== hash_hmac('sha256', $file . '|' . $expires, $secret)) { http_response_code(403); exit; }
$path = '/var/www/protected_audio/' . basename($file);
if (!is_readable($path)) { http_response_code(404); exit; }
header('Content-Type: audio/mpeg'); header('Content-Disposition: inline; filename="' . basename($path) . '"');
readfile($path);

Final notes: tokenization and streaming only deter casual copyers; they don’t stop screen/audio recorders. If the music isn’t your own work you need permission to publish it. For distribution control with minimal fuss, consider using a third‑party streaming/sales platform that handles licensing and playback controls rather than self‑hosting.

Recommended Answers

All 15 Replies

Use JavaScript for example

errrrrr giz a hand

<SCRIPT LANGUAGE="JavaScript">
function playSound(soundUrl)
{
	document.getElementById("sounds").src = soundUrl;
}
</SCRIPT>

and something like

bgsound="javascript:playSound('song location')"

thank you for that :) I will copy in the HTML code later

please 'memba im not thick its just im 13 and still learning

Killswitch

Does'nt seem to work... im pretty new to using HTML could you give me any more advice or help?. It would be much appreciated

Thanks,
Killswitch

I'm confused. Anyone would be able to view the source of the HTML page, see the location of the sound file, and download it directly? You would need to stream media somehow ... a streaming server? I'm not exactly sure how it works :)

I'm confused. Anyone would be able to view the source of the HTML page, see the location of the sound file, and download it directly? You would need to stream media somehow ... a streaming server? I'm not exactly sure how it works :)

Yeah you can put in place a media player in your site so that the music/vid plays in it. I havent tried this to see if it stops ppl being able to download the music.

Do you even know what "downloading" is? (Sorry for being abrasive.) It is impossible for a user's computer to play the music that is on your server without having downloaded it first.

What you want is impossible.

Do you even know what "downloading" is? (Sorry for being abrasive.) It is impossible for a user's computer to play the music that is on your server without having downloaded it first.

What you want is impossible.

no, What i want is for people to open the music within the site and not be able to download it on their pc as downloading the music for free would be illegal....

Killswitch

Well, looks like this is going nowhere. Why ? :?:
Because you did not give us exact idea of what you whant. Through what I red in rest of posts I thing I know what you are looking for.

Check this website and tell me if is this what you are looking for


Press the button "Listen to ringtone"

what is that link that link is a link to phones... ringtones n stuff wtf ???

That is an example how it can be done. You dummy.

Press a button and woalaa music.

There been already 3 people which try to help you and still you did not state what exactly you whant

Next time please read full sugestion and not part of it!!!

Wow, calling someone a name is hardly productive.

You could try using Flash to play the music, but it is still cached. My suggestion is to not add music to your site. It will slow the load of the site down and likely annoy people who don't want to hear it.

If you insist on having music, let the user decide if they want to hear it, don't force it on them.

ok thanks for the advice :)

Since the music must be on the user's computer to be played, it must be downloaded.

There is no way to keep a smart user from finding the file the browser saved to their hard drive and copying it to another file.

Better to register your copyright, so if someone else steals your creation, you can sue.

If it's not your music, and it is not in the public domain, you are infringing if you use it in your site, whether they save the file or not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.