Difference between revisions of "0AAC"

From GTAMods Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 
{{OpCode
 
{{OpCode
| ini        = 0AAC=2,%2d% %1d%
+
| games      = {{Icon|SA}} (with [[CLEO]])
 
| description = Loads an MP3 file from given path
 
| description = Loads an MP3 file from given path
| p1          = Variable to store the mp3 handle
+
| syntax1    = 0AAC: [''var''] = load_audiostream "[''string'']"
| p2          = Path to MP3 file. MP3 file name
+
| p1t        = [''string'']
| game        = San Andreas
+
| p1d       
 +
| p2t        = [''var'']
 +
| p2d        = Variable to store the handle of the MP3
 
}}
 
}}
 +
This opcode loads an MP3 file from the given path. It is used in conjunction with opcodes [[0AAB]] and [[0AAD]]
  
This opcode loads an MP3 file from the given path. It is used in conjunction with opcodes [[ 0AAB ]] and [[ 0AAD ]]
+
==Example==
[[Sanny Builder]] example:<source lang="scm">0AAC: $hMP3 = load_mp3 "CLEO\playlist\01.mp3"
+
This is an example code and should not be copied verbatim. The following codes is for San Andreas using Sanny Builder's format.
</source>
+
<syntaxhighlight lang="scm">
 +
{$CLEO .cs}
  
==Notes==
+
0000: NOP
The MP3 opcodes have been known to cause crashes on some occasions. Take care when using these opcodes.
+
while true
 
+
    wait 0 ms
==Examples==
+
     if and
The following code is only an example and has not been tested nor is it complete, thus meaning it should not be copied and compiled.
+
        0AB0:   key_pressed 77 // M
<source lang="scm">
+
         0AAB:   file_exists "CLEO\PLAYLIST\01.MP3"  
:START
+
    then
wait 0 ms
+
        0AAC: 0@ = load_mp3 "CLEO\PLAYLIST\01.MP3"
if
+
        wait 1000 ms
     Player.Defined($PLAYER_CHAR)
+
        0AAD: set_mp3 0@ perform_action 1
jf @START
+
        0A93: end_custom_thread
if and
+
     end
    0AB0: key_pressed 77 //M
 
         0AAB: file_exists "CLEO\playlist\01.mp3"
 
then
 
    0AAC: $hMP3 = load_mp3 "CLEO\playlist\01.mp3"
 
else
 
     jump @START
 
 
end
 
end
 +
</syntaxhighlight>
  
:SECOND
+
==Keywords==
wait 1000 ms
+
load, mp3, audio, sound
0AAD: set_mp3 $hMP3 perform_action 1
 
0A93: end_custom_thread
 
</source>
 
  
A MP3 [[ CLEO ]] plugin written by Seemann available at [http://cleo.sannybuilder.com]
+
==See also==
 +
* [http://cleo.li/download.html MP3 Player] - a [[CLEO#Plugins|CLEO plugin]] written by {{U|Seemann}}
 +
* {{GTAF|399466|jPlayer mod}}
  
jPlayer mod: [http://www.gtaforums.com/index.php?showtopic=399466]
+
==Notes==
+
The MP3 opcodes have been known to cause crashes in CLEO3 on some occasions. Take care when using these opcodes.
 
 
==Keywords==
 
load, mp3
 
  
[[Category:Mission Scripting]]
+
[[Category:CLEO Opcodes]]

Latest revision as of 00:58, 20 November 2016

San Andreas (with CLEO)


Description
Loads an MP3 file from given path
Syntax
0AAC: [var] = load_audiostream "[string]"
Parameter
[string]
[var]
Variable to store the handle of the MP3

This opcode loads an MP3 file from the given path. It is used in conjunction with opcodes 0AAB and 0AAD

Example

This is an example code and should not be copied verbatim. The following codes is for San Andreas using Sanny Builder's format.

{$CLEO .cs}

0000: NOP
while true
    wait 0 ms
    if and
        0AB0:   key_pressed 77 // M
        0AAB:   file_exists "CLEO\PLAYLIST\01.MP3" 
    then
        0AAC: 0@ = load_mp3 "CLEO\PLAYLIST\01.MP3"
        wait 1000 ms
        0AAD: set_mp3 0@ perform_action 1
        0A93: end_custom_thread
    end
end

Keywords

load, mp3, audio, sound

See also

Notes

The MP3 opcodes have been known to cause crashes in CLEO3 on some occasions. Take care when using these opcodes.