Audio in editor mode.

Hello !!

I’m looking for a way to play an audio clip from a custom editor window, is it possible? Everything I found are hacks or things like that…
If it’s not possible, is it in the roadmap? Because while it’s impossible to do so, it’ll remain really hard to build proper alternative to middleware like FMOD or Wwise inside Unity without replacing all the audio system… Be able to play a sound from a clip and send it to a mixer while in edit mode would allow us to improve drastically the capability of audio editors inside Unity.

Thank you for your help!

1 Like

I used to use “UnityEditor.AudioUtil” “PlayClip” via reflection (also a hack), but it doesn’t work. I’m ok with hacks, but I need a new one.

You can add the ExecuteInEditMode attribute to a monobehaviour which has an audiosource and then make it play clips.

1 Like

For future reference, they renamed the methods to PlayPreviewClip and StopAllPreviewClips

Answer here

2 Likes