AlxGetStreamDuration(%handle); Issue
by AllynMcelrath · in Torque Game Engine · 10/26/2007 (12:44 pm) · 6 replies
Its seems that using alxGetStreamDuration returns an unuseable value and gives an error of "invalid handle".
However, even with in the same function alxIsPlaying operates correctly and gives a value of use.
Conside the deffinition from the Offical documents.
My question is: Is alxGetStreamDuration broken, or am i using it incorectly?
Any insight in English (lol, as is try not to get to programmer jargon on me) is appreciated.
Thanks.
However, even with in the same function alxIsPlaying operates correctly and gives a value of use.
Conside the deffinition from the Offical documents.
Quote:alxGetStreamDuration( handle )
Purpose
Use the alxGetStreamDuration function to determine the length of a previously set up sound in seconds.
Syntax
handle - The ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
Returns -1 for invalid handle, and 0.0 to N.M for valid handle indicating length of scheduled sound in seconds.
See Also
alxGetStreamPosition
My question is: Is alxGetStreamDuration broken, or am i using it incorectly?
%handle = alxPlay(%musicBitToPlay, %positionX, %positionY, %positionZ); %time = alxGetStreamDuration(%handle); --> -1 (invalid handle) alxIsPlaying(%handle); --> 1 (not invalid handle, and is playing)
Any insight in English (lol, as is try not to get to programmer jargon on me) is appreciated.
Thanks.
#2
10/29/2007 (6:48 am)
Try %sndTime = alxgetwavelen(%AudioProfile.filename);
#3
What is implied by the use of "Stream", versus "Wave" ? Do they refer to the use of ogg Versis .wav? (I think so, just need confirmation)
They seem to do the same thing, according to the description in the documents and on TDN.
(What does N.M Stand for?)
V.S
The only difference i see is one check the FILE, while the other checks the Audio Profile (I am assuming), also, one reports seconds, and the other milliseconds. The problem here is, if i use alxGetStreamDuration, then it should (from what i understand) be file type irrelevent...as its checking the profile... But alxGetWaveLen , says its check the FILE that must be a WAV, but i intend to use Ogg.
This also dost explain the errors i get when using alxGetStreamDuration.
What this all reads as to me (please confirm) is that i can use alxGetWaveLen to get , in seconds, the time of a file. However, using alxGetStreamDuration, i can check the length of time, in milliseconds , of a sound already set up with a profile... This also opens up the ability to use other functions of that group, such as alxGetStreamPosition (That i need).... But currently i cant get alxGetStreamDuration to give me a valid number, and no error.
I'm stumped.
10/29/2007 (10:54 am)
Thanks, that was my alternative, However, the difference in the functions confuses me...What is implied by the use of "Stream", versus "Wave" ? Do they refer to the use of ogg Versis .wav? (I think so, just need confirmation)
They seem to do the same thing, according to the description in the documents and on TDN.
Quote:alxGetStreamDuration( handle )
Purpose
Use the alxGetStreamDuration function to determine the length of a previously set up sound in seconds.
Syntax
handle - The ID (a non-negative integer) corresponding to a previously set up sound source.
Returns
Returns -1 for invalid handle, and 0.0 to N.M for valid handle indicating length of scheduled sound in seconds.
See Also
alxGetStreamPosition
(What does N.M Stand for?)
V.S
Quote:alxGetWaveLen( fileName )
Purpose
Use the alxGetWaveLen function to get the play-length of a specified sound file in milliseconds.
Syntax
fileName - A full path to legally formatted sound file.
Returns
Returns play-length of the WAV file specified by filename in milliseconds.
See Also
alxGetStreamDuration, alxGetStreamPosition
The only difference i see is one check the FILE, while the other checks the Audio Profile (I am assuming), also, one reports seconds, and the other milliseconds. The problem here is, if i use alxGetStreamDuration, then it should (from what i understand) be file type irrelevent...as its checking the profile... But alxGetWaveLen , says its check the FILE that must be a WAV, but i intend to use Ogg.
This also dost explain the errors i get when using alxGetStreamDuration.
What this all reads as to me (please confirm) is that i can use alxGetWaveLen to get , in seconds, the time of a file. However, using alxGetStreamDuration, i can check the length of time, in milliseconds , of a sound already set up with a profile... This also opens up the ability to use other functions of that group, such as alxGetStreamPosition (That i need).... But currently i cant get alxGetStreamDuration to give me a valid number, and no error.
I'm stumped.
#4
Returns : Position: -1
Yes, the audio is playing.
10/29/2007 (11:17 am)
Just tested alxGetStreamPosition , it returned a -1 just like alxGetStreamDuration.if (alxIsPlaying(%handle)) {
echo ("Position: " @ alxGetStreamPosition(%handle));Returns : Position: -1
Yes, the audio is playing.
#5
11/10/2007 (5:13 pm)
This is a still an issue and i have no resolution for it yet.
#6
11/12/2007 (1:23 pm)
Someone MUST have some feedback on this...
Torque Owner AllynMcelrath