How to stream music from my PC onto the server?
#1

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:
Reply
#2

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)..
Reply
#3

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 ?
Reply
#4

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

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
Reply
#6

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.
Reply
#7

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");
Reply
#8

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)