How to control speed of animation on Unity by a .txt file?

I am trying to controlling the flow of an 3D animation on unity through the sound. Therefore, through a synthesizer sounds, get the BPM of a song, which are stored in a file. Txt, with the given time and the number of BPM in second. Then in Unity, I have a pre-defined animation, and already carry the file with the information of BPM, but now I do not know how I can make the animation speed is controlled by the information in that file. Any idea?

Add the text file into your Resources folder. Then it’s accessible in your game code as a TextAsset. See: