Get Amplitude returning -nan(ind) float value

I’ve set up a blueprint that works as a lip-synching tool for a character by triggering a morph target based on the audio amplitude. I’m using the Get Amplitude node from the Sound Visualization plugin (which I’m aware does not package in games, but I am only using this for exporting video). The blueprint will work great for a while, but eventually it breaks, and always at the same place.

I’ve tracked down the source of the problem to the array of numbers that is output from the Get Amplitude node. When everything is working, it outputs an ever-changing array of numbers roughly between 0 and 7000, but at the breaking point (which always occurs at the exact same place), it will return a value of -nan(ind) at index [0] and from there on out it locks up all the other numbers and they just keep returning the same values.

I’ve tried multiple audio files and all of them run into the same problem, returning the same exact values at the breaking point for all 10 indexes in the array, but the breaking point occurs at a different time on each file, so it’s not like all files are breaking at 3 seconds in. And I can’t spot any obvious trigger in the audio wav forms that would be causing a break. Also, changing the settings in the Get Amplitude node don’t seem to have any affect on when/how the break occurs.

I’m really at a loss. Does anyone have any ideas how to fix or avoid this problem?

Upon further testing and research, I’m finding that I should be using something other than “Get game time in seconds”. This seems to be what’s really causing the trouble, perhaps due to the fact that I am calling this function from an event on a sequencer timeline, a few seconds into the animation. The only problem is, I’m not sure what I should be using instead. If anyone has suggestions, I’m all ears.

Hey so not sure if you were able to solve this or not. I was having the same issue because I’m layering beats and don’t all start from the begging. By just playing around I was able to figure out that it sort of uses the time from the begging of the track to the end to detect the amplitude or frequencies. So what I did was basically try to replicate my own float counting time.

I grab the duration of the song and depending on if it loops or not I reset it back to 0 and then have it calculate again. Not sure if the math is 100% right for setting the time but it works for me at the moment. Hope this helps!