DeleteUnityAudioSource
delete the Unity audio source component obj.
DeleteUnityAudioSource["name"]
delete the Unity audio source component with the specified name.
Details
- DeleteUnityAudioSource destroys the Unity audio source component, and releases any references to obj.
- DeleteUnityAudioSource[All] destroys all the audio sources in the current scene.
- DeleteUnityAudioSource is Listable
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
To use UnityLink, you need first to load the package:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-buodkt

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-c28u0u

Find and delete an AudioSource component:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-sq5c43


https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-0xsjko
Delete an AudioSource component by name:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-7y1zcv
Scope (4)Survey of the scope of standard use cases
Find and delete a Unity audio source component:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-dsnpnc


https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-7miave
Delete the Unity audio source component by name:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-qxth02
Delete the Unity audio source component on a given game object:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-z93ks0


https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-l0j5hu
Delete all audio sources in the current scene:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-q6lkw1
Possible Issues (1)Common pitfalls and unexpected behavior
A UnityAudioSource cannot be accessed after deletion:

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-qfg4jm


https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-ji5ikx

https://wolfram.com/xid/0ejji9zcx9pevyq88fh20erky-yh8es3


Wolfram Research (2019), DeleteUnityAudioSource, Wolfram Language function, https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html.
Text
Wolfram Research (2019), DeleteUnityAudioSource, Wolfram Language function, https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html.
Wolfram Research (2019), DeleteUnityAudioSource, Wolfram Language function, https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html.
CMS
Wolfram Language. 2019. "DeleteUnityAudioSource." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html.
Wolfram Language. 2019. "DeleteUnityAudioSource." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html.
APA
Wolfram Language. (2019). DeleteUnityAudioSource. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html
Wolfram Language. (2019). DeleteUnityAudioSource. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html
BibTeX
@misc{reference.wolfram_2022_deleteunityaudiosource, author="Wolfram Research", title="{DeleteUnityAudioSource}", year="2019", howpublished="\url{https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html}", note=[Accessed: 05-April-2025
]}
BibLaTeX
@online{reference.wolfram_2022_deleteunityaudiosource, organization={Wolfram Research}, title={DeleteUnityAudioSource}, year={2019}, url={https://reference.wolfram.com/language/UnityLink/ref/DeleteUnityAudioSource.html}, note=[Accessed: 05-April-2025
]}