The class AudioPlayer acts similar to the Sound class, but is lacking a “Play” button to hear the audio within studio. With a selected sound object, you are able to preview the sound from the properties pane. This is a fantastic QoL feature and similar QoL features should be maintained in new objects classes.
Expect to see a Play/Preview button when inspecting an AudioPlayer, but it doesn’t exist.
AudioPlayer is basically a Sound but for the new audio API. The new audio API was released a while back and it has got a much better workflow, and a whole tonne more features than old sounds. Just look it up.
My question is, if AudioPlayer is supposed to be the successor to Sounds, why would they remove the preview option? Seems kind of an oversight by them I feel.
But yeah this would be nice, I want to use the new API so bad but haven’t bothered because of this fact that I can’t preview the audio without making an entire test setup.
Hi! Currently you can use the IsPlaying property for this - it should work in edit mode (unlike Sound, which does not ordinarily play in edit mode) as long as your AudioPlayer is ready and wired up in advance, although it will change the AudioPlayer’s TimePosition.
We are looking into adding the previewer back, but it currently uses some pretty old tech, so it’s tricky - can’t give any firm promises yet.
I see the previewer has been added, is there any way to get it working without needing to wire everything manually? I handle all my wiring at runtime, so if I want to preview audio, I end up having to set up a bunch of wires just for that. At that point, it’s honestly easier to just spawn in the legacy Sound instance.
Not currently - for now we aren’t able to do much more than make the previewer control the existing IsPlaying and TimePosition properties on AudioPlayer, but we’re hoping to expand on it in the future.