Quantcast

Jump to content

» «
Photo

CLEO sound length milliseconds

1 reply to this topic
HeresOtis
  • HeresOtis

    The SCM Undergrad

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#1

Posted 24 July 2014 - 08:49 AM

Any way to get the actual length of a sound in milliseconds? My walkietalkie.mp3 is about 1.6 seconds long. How can I read the exact length of it instead of an rounded length??

0AC1: load_3d_audio_stream "audio\SAPDFR\Walkietalkie.mp3" store_to hWalkieTalkieSound
0AAF: get_audio_stream_length hWalkieTalkieSound store_to iWalkieTalkieLength
iWalkieTalkieLength *= 1000

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#2

Posted 25 July 2014 - 02:19 PM

const  
iWalkieTalkieLength = 0@
hWalkieTalkieSound = 1@
end

// play mp3 and restore 33@
0AAD: set_mp3 1@ perform_action 1
33@ = 0


// then in a Loop
0AAF: iWalkieTalkieLength = get_mp3_length hWalkieTalkieSound // - V 1 sascm.ini - 

iWalkieTalkieLength *= 1000
//iWalkieTalkieLength -= 33@
0062: 0@ -= 33@ // (int, writing opcode and NOT CONSTANTS is needed, because math code with 2 vars) 
03F0: enable_text_draw 1
045A: draw_text_1number 450.0 200.0 GXT 'NUMBER' number 0@




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users