CLEO Help .mp3 in Cleo

CLEO related
Status
Not open for further replies.

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
I want to know if we can run a .mp3 file in a cleo, if we can, then how will we able to repeat it so that it would just keep repeating after it ends.
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
That is nice, but I don't want a separate mod, Not the one which has its copy right issues.

Give me the permission to edit it by the way I want and reupload, I want it to be simple, no credits when the game starts and such.
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
Can someone just give me the opcodes needed to stream a .mp3 file, an dhow to loop it again after a specific time.
 

MrChristmas

Expert
Joined
Jul 29, 2014
Messages
563
Reaction score
26
The Cleo is open source so you can play with it any anytime,
You don't need to include the credits who made it (Like 90% of faggots do) but its always good to have that.

If you want to loop it then one way to do it is calculate the song length in ms then do wait [ms time of song] and repeat or goto different sub where the stream starts.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
0AAC: $hMP1 = load_audiostream "CLEO/MUSIC/oFinder_audio/1.MP3
0AAE: release_mp3 $hMP1
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play, 2=pause, 3=resume
0ABC: set_audiostream $hMP1 volume 1.0
0AAF: 0@ = get_mp3_length $hMP1

+

i had something like that commented out for some reason in the code (i don't remember why)
//0AB9: get_mp3 $hMP1 state_to 10@
//    if 10@ == 2
//
//1 = file is playing
//2 = file paused
//-1 = file is stopped

some functions to use multiple songs with little control panel
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
Then I can enter the wait opcode and after that I can make a goto checkpoint to where I started the stream?

If anyone could just post a code where including Monday's code.
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
Code:
{$CLEO .cs}

thread 'MUSIC'

:MCleo_01
wait 0
if
0AB0:   key_pressed 104
else_jump @MCleo_02
0AAC: $hMP1 = load_audiostream "CLEO/MUSIC1.MP3"
0AAE: release_mp3 $hMP1
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play, 2=pause, 3=resume
0ABC: set_audiostream $hMP1 volume 1.0
0AAF: 0@ = get_mp3_length $hMP1
jump @MCleo_01

:MCleo_02
wait 0
if
0AB0:   key_pressed 105
else_jump @MCleo_01
0AAC: $hMP1 = load_audiostream "CLEO/MUSIC1.MP3"
0AAE: release_mp3 $hMP1
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play, 2=pause, 3=resume
0ABC: set_audiostream $hMP1 volume 0.0
0AAF: 0@ = get_mp3_length $hMP1
jump @MCleo_01


What am I doing wrong here, I get Opcode errors when I press F9.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
man, I just posted few opcodes that you could use, but copy/pasting them all into a loop won't give a good result xd

This should be called at the begining of the script
0AAC: $hMP1 = load_audiostream "CLEO/MUSIC1.MP3"

This should be called once whenever you want to stop/play/pause/resume the song
0AAD: set_mp3 $hMP1 perform_action 1 //0=stop, 1=play, 2=pause, 3=resume

These two should be called whenever you want to change song
0AAE: release_mp3 $hMP1 //not even sure about this one but that's how i used it
0AAC: $hMP1 = load_audiostream "CLEO/justinbarber.MP3"
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
:yesyes: Everything went well, but when I play it after stopping it, the voice gets a but mixed up and it gets loud, its as if the .mp3 file is running multiple times at once.
 

MrChristmas

Expert
Joined
Jul 29, 2014
Messages
563
Reaction score
26
monday link said:
0AAE: release_mp3 $hMP1 //not even sure about this one but that's how i used it

It need stop be used because it releases the buffer for that .mp3 to be played :) but its always good to release 3 buffers next to the first one (so if you use 2 then you should release 2, 3 and 4) so the cleo won't get confused and more buffers are available.

The gay Gamer link said:
:yesyes: Everything went well, but when I play it after stopping it, the voice gets a but mixed up and it gets loud, its as if the .mp3 file is running multiple times at once.

Post the code pls
 

Child_

Active member
Joined
May 9, 2015
Messages
115
Reaction score
0
:eek:key:

Code:
{$CLEO .cs}

thread 'MUSIC'

:MCleo_01
wait 0
if
0AB0:   key_pressed 104
else_jump @MCleo_02
0AAC: $hMP1 = load_audiostream "CLEO/MUSIC1.MP3"
0AAD: set_mp3 $hMP1 perform_action 1
jump @MCleo_01

:MCleo_02
wait 0
if
0AB0:   key_pressed 105
else_jump @MCleo_01
0AAD: set_mp3 $hMP1 perform_action 2
jump @MCleo_01
 
Status
Not open for further replies.
Top