[Tutorial] How to create an mp3 player command with PlayAudioStreamForPlayer
#1

Making an mp3 player/playlist with as a command.

Introduction

well for a while now i have been struggling to find a site with playaudiostreamforplayer witch will work seen as igonitos streamer plugin did'nt work for me.

Starting out.

Ok first we want to make a basic mp3 audio file with a few songs on witch is not in different mp3 files so like a song plays after an other so basicly we don't really need to add timers.

To do this open up any movie editing tool or a music editing tool witch lets you add multiable music files. I will be using windows movie maker.

Once its open go to where you would go in that tool to add music, mine is import audio and music. After that if your using windows movie maker drag your audio files into the video part with out making a video and once all audio is done save the file. It should Look something like this:


Uploading it to the web
The next part is now adding the mp3 to the web so it loads up the site i preview to use is kiwi6.com Once on kiwi6.com go to browse and upload the file you just made. After around 5 - 10 mins depending how large the mp3 file is. Once its uploaded right click the page and go to view source and go down to find a url that looks like this http://k002.kiwi6.com/hotlink/o8gr9q..._song_name.mp3

The coding.
Okay now we are going to make the command to play the song witch will be /mp3

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
//worlds
if (strcmp("/mp3", cmdtext, true, 10) == 0)// the mp3 command
{
PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/o8gr9q3g0c/boyce_avenue_every_breath.mp3"); //the mp3 link to music use this if you wish.
return 1;
}

and you are done. if you want to use my song feel free to use it here http://k002.kiwi6.com/hotlink/o8gr9q...ery_breath.mp3 i am currently uploading my mp3 play list link If you found this helpful please rep.
Reply
#2

Looks really basic...
I don't call this a mp3 player at all.
It only plays one music file in this one.
Just create a tutorial with dialogs in it etc...
Sorry, 1/5.
Reply
#3

Quote:
Originally Posted by timothyinthehouse
View Post
Looks really basic...
I don't call this a mp3 player at all.
It only plays one music file in this one.
Just create a tutorial with dialogs in it etc...
Sorry, 1/5.
If you do the windows bit to put other mp3s in it u can make a 1 hour long single mp3 music file witch has around 20 songs on but after u do windows movie maker part of the tutorial u have to convert and ye ill make a tutorial with dialogs next probz. but thanks for feed back.
Reply
#4

Good tutorial man, glad to see people are contributing to the new features of sa-mp.

Basic and a nice little rig to make the song like a hour long. This will work on any server correct?
Reply
#5

Quote:
Originally Posted by Oh
View Post
Good tutorial man, glad to see people are contributing to the new features of sa-mp.

Basic and a nice little rig to make the song like a hour long. This will work on any server correct?
Ye it will work on any server with 3d.
Reply
#6

That dosen't work for me :S, maybe is lag?
Help me please :S
Reply
#7

This isn't an MP3 player, it's just making a command to stream a playlist. If it was an MP3 player you would show people how to stream their custom playlist via a dialog, now that's an MP3 player. How ever, good job on creating a tutorial. Just rather shit how you called it an "MP3 player command" when it's nothing like an MP3 player, the commands just called "/mp3" ....
Reply
#8

Im getting runtime error here,no idea whats causing it but as i remove the code it works again.I have updated everything do I need some kind of plugin for this?
Reply
#9

Hello Nathan!
Reply
#10

Quote:
Originally Posted by eemalekorraks
View Post
Im getting runtime error here,no idea whats causing it but as i remove the code it works again.I have updated everything do I need some kind of plugin for this?
ok sorry it took me a while to get back to you, you dont need any plugins you only need 3d.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)