How can I not preload an audio file before playing?

hi,
I need to know how I can not preload an audio file before playing and how to free up the memory after playing?
my guess is to have an Audiosource component and enable it when I need to play the audio clip and then disable it after I am finished playing. but I need to sure that the audio clip isn’t loaded onto the memory when the Audiosource is not enabled.
thanks!

You need to put audio file in resources folder in your project and use it with

cc.loader.load()

I am sure this is covered in tutorials. Go check that for full usage.

I think you can load the assets with cc.loader.load() and release with cc.loader.release()

https://docs.cocos2d-x.org/creator/manual/en/scripting/load-assets.html