SA-MP Forums Archive
How to stream music from my PC onto the server? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to stream music from my PC onto the server? (/showthread.php?tid=514406)



How to stream music from my PC onto the server? - ThatThoseTheThy - 21.05.2014

How to stream music from my PC onto the server?

I know you have to use
Код:
PlayAudioForPlayer(playerid, "URL.mp3");
but for some reason when i upload a file to a music uploading thing, and put it in script it doesn't sound a thing.


(I am using Bare script here is the code");
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx;
	new cmd[256];
	
	cmd = strtok(cmdtext, idx);

	if(strcmp(cmd, "/song", true) == 0)
    {
        PlayAudioStreamForPlayer(playerid, "http://kiwi6.com/file/qpxbus44fp");
    	return 1;
	}

	return 0;
}
it worked with the link they provided. I heard here and there that you need a .mp3 at the end of the link, but i can't find a hosting thing that will make it that way. Any ideas?


More info:



Re: How to stream music from my PC onto the server? - Scrillex - 21.05.2014

Basically you need a web host to do that.. + If you will use localhost only you will hear the sound so you need to port forward your ports (if you are using router)..


Re: How to stream music from my PC onto the server? - ThatThoseTheThy - 21.05.2014

Is there a way that if I put my content in a folder somewhere, will it play the music? some plugins were rather hard to obtain.


Or is there a good suggestion for a Music file host that works ?


Re: How to stream music from my PC onto the server? - ThatThoseTheThy - 21.05.2014

Bumping this..... Could help, maybe a good plugin for this?


Re: How to stream music from my PC onto the server? - rumen98 - 21.05.2014

ThatThoseTheThy, if your hoster have a open port 80 you can use Wamp Server to make your Own free hosting and drag music files in ,,C:/wamp/www/musicfolder'' and open it with example http://127.0.0.1/musicfolder/welcome.mp3 for URL
I hope I helped you


Re: How to stream music from my PC onto the server? - rymax99 - 21.05.2014

You'll need to either buy a web hosting plan or something alike, or if it's just a testing server then simply install a web server such as Apache or Nginx (Nginx is more straight forward/portable). Sometimes you can't access your public IP internally, if that's the case, simply get a free domain such as a domain from Dot TK, or a No-IP redirect, and then stream from that URL.


Re: How to stream music from my PC onto the server? - Abagail - 21.05.2014

The issue is that you have you are not playing an audio file. You have:
pawn Код:
PlayAudioStreamForPlayer(playerid, "http://kiwi6.com/file/qpxbus44fp");
Which should be:
pawn Код:
PlayAudioStreamForPlayer(playerid, "http://kiwi6.com/file/qpxbus44fp.mp3");



Re: How to stream music from my PC onto the server? - ThatThoseTheThy - 23.05.2014

Well i have solved the problem, as Abagail said you need a .mp3 in the end. For those who stumble upon this topic and need a answer here it is:

1) Go to http://mp3skull.com/
2) Search for your song name
3) when you find a link you like click on the "Download" button. it should either
(a) actually download a song
(b) move you to a new window with black arund it and a liltle player in the middle



if (b) hapends then move on to this:
4) then copy the link and add it to the PlayAudioStreamForPlayer(playerid,"URL.mp3");




Hope this helps you as it helped me!