/    Sign up×
Community /Pin to ProfileBookmark

is there a PHP function that would run an audio file

Hi, is there a way to run audio files from PHP code without having an html window open on the user’s PC but just have the audio program like real player open to play the audio file

Thanks,
Salam

to post a comment
PHP

11 Comments(s)

Copy linkTweet thisAlerts:
@brendandonhueSep 02.2003 — No, it would be a security risk to allow you to run programs on other people's computers.

What is wrong with just embedding the file in HTML anyway?
Copy linkTweet thisAlerts:
@SalamauthorSep 02.2003 — Hi, I did not mean runing a program on the user's PC. I want to write a PHP file that runs the adio file that is on my server without having to return the address of the audio file within html code to the user's PC. So the user will click a link on a one of my pages. The link is to a PHP file. The PHP file just causes an adio file on my server to play for the user.

Thanks,

Salam
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 02.2003 — As far as I know, there is no way to play the audio file without exposing it's location. The only thing that you could do in PHP would be to redirect the user to the file, but I don't think that's what you're looking for. Try posting in the JavaScript section. You could probably include a javascript file that contains a function to play the audio file. Hope that helps!
Copy linkTweet thisAlerts:
@SalamauthorSep 02.2003 — Hi PunkSktBrdr01, actually I do not think that the javascript trick will help because it runs on the user's PC and thus the audio file's link will be exposed ?

Salam
Copy linkTweet thisAlerts:
@brendandonhueSep 02.2003 — Ok, I understand what you mean a bit better now.

I don't think you can actually play the audio file directly using PHP, as PHP generates HTML, which would have to contain the URL of the sound file.


If you tell us the purpose of hiding the URL of the audio, maybe we can find another method. Is it so the user can't download or copy the file?
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 02.2003 — Actually, I think the JavaScript thing might work. I didn't mean using include(), but using <script language="JavaScript" type="text/javascript" src="file.js">. It would still be exposed in the "file.js" file, but if you add a lot of other code in the file, it would be hard to find. I doubt there is a way to completely hide the location of the file, though, because the user's computer needs to know where the file is to request it and play it.
Copy linkTweet thisAlerts:
@SalamauthorSep 02.2003 — Hi brendandonhue, yes the reason is to prevent the possibility of downloading a copy of the file.

Hi, PunkSktBrdr01, I agree with you on what you wrote. That will make it hard for most people to figure out.

Thanks,

Salam
Copy linkTweet thisAlerts:
@brendandonhueSep 02.2003 — Maybe there is some possibility you can use a streaming server such as SHOUTCast or Darwin? That would stop people from directly downloading the files, but im not really an expert in this area.
Copy linkTweet thisAlerts:
@Khalid_AliSep 02.2003 — Yes it will stop direct download of course.

But htey still can capture any audio/video coming out of their audio/video card.....why bother going thru this much hastle while you can not stop it... huh????
Copy linkTweet thisAlerts:
@brendandonhueSep 02.2003 — Yes, I know they can capture it using many free programs that capture sound directly from the sound card, but I'm not sure that is the issue here.....maybe it is. Using a streaming server will stop most casual downloaders though...
Copy linkTweet thisAlerts:
@SalamauthorSep 03.2003 — Thanks for all of you who have responded ? I just was hopping there is simply a PHP function call. Its not worth it if its more complecated than that.

Thank you all

Salam
×

Success!

Help @Salam spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...