# Changing a Sound's Pitch should change the Sound's TimeLength value respectively

Sorry if this is the wrong place to post this.

I know you can just divide the the Sound’s TimeLength by the pitch in order to get the true TimeLength, but it should be done by default.

I don’t think it should… To get the default time you would then have to set the pitch back to the default of 1. It’s just cleaner and better practice to do as you said in the OP, which is dividing the TimeLength by Pitch. TimeLength should always be the actual sound assets length imo.

What purpose does the TimeLength value serve if it doesn’t correspond with the actual length of the audio based on it’s pitch?

What purpose does the TimeLength value serve if it doesn’t correspond with the actual length of the audio based on it’s pitch?[/quote]

It’s the length of the sound, not the length of the audio playing, if you want the length of the audio playing, just divide sound length by sound pitch, makes sense to me…

What purpose does the TimeLength value serve if it doesn’t correspond with the actual length of the audio based on it’s pitch?[/quote]
It shows what the uploaded time is without having to do extra math.

Edit: See Weeve’s post

What purpose does the TimeLength value serve if it doesn’t correspond with the actual length of the audio based on it’s pitch?[/quote]

Because Pitch is a variable that can be changed, TimePosition is not and so should always correspond with the actual sound asset, because anything else that you want to achieve can be done through Lua.

Say I’m making a radio, I want to have a “Fast Forward” button, I want to set the pitch to 2.0 which gives me playback at x2. Now, when I am looking at the “Music” time position, I want to be able to see my actual time position, not one based off how high my pitch is. This is just one of many examples. You wouldn’t be able to do that if the TimeLength was based on Pitch. If you can give me any example of something you can’t do because the TimeLength doesn’t adjust to Pitch then I may change my view. I personally can’t think of any though.

This is also the case for lots of other engines by the way.

What purpose does the TimeLength value serve if it doesn’t correspond with the actual length of the audio based on it’s pitch?[/quote]

Because Pitch is a variable that can be changed, TimePosition is not and so should always correspond with the actual sound asset, because anything else that you want to achieve can be done through Lua.

Say I’m making a radio, I want to have a “Fast Forward” button, I want to set the pitch to 2.0 which gives me playback at x2. Now, when I am looking at the “Music” time position, I want to be able to see my actual time position, not one based off how high my pitch is. This is just one of many examples. You wouldn’t be able to do that if the TimeLength was based on Pitch. If you can give me any example of something you can’t do because the TimeLength doesn’t adjust to Pitch then I may change my view. I personally can’t think of any though.

This is also the case for lots of other engines by the way.[/quote]

I believe that example is flawed. If you’re making a ‘fast forward’ feature ,you want TimePosition to update at the same speed as as the Pitch as then you can simply check for a certain TimePosition to automatically stop the ‘fast forward’.

However, TimeLength should refer to the actual length of the audio stream, simply because it’s more useful that way. You an do more with it representing the full length than pitch-adjusted length.