Auditioning WAV files within Plugin

Hi, I want to be able to play some WAV files when the DAW is stopped, so the user can audition them and choose one. Should the DAW’s audio driver be used for this, and is it available when the program is stopped. Also, do my WAV files need to match the sample rate of the current project for example if my WAV files as 44.1K and the project is 48Kz can I audition my files when the DAW is stopped?

Since some DAW’s wouldn’t be able to audition WAV files at rest, I’d like to have a plan B option that would have my own auditioning of the WAV files. Are there any components for this, for example, in other Windows desktop programs I’ve found components that use Windows Media Player (embedded in the form so it appears as part of the plugin GUI), and that plays all kinds of audio files.

It unfortunately is just a very bad idea to attempt to use the audio hardware from within a plugin that is in a host that already may have the audio hardware reserved. It may work on some systems and configurations but just as well might not. But if you insist on trying, JUCE of course has the AudioDeviceManager that can be used to output audio into the hardware. AudioSourcePlayer would be a useful class to use with that.

I haven’t worked on plugins for a while, but is there a way to use processBlock to send the auditioned audio? I assume it gets called continuously if your an instrument plugin?

It’s again one of those things where the host might or might not, depending on various factors.

Still, I suppose most hosts will keep on calling the processBlock method if the track is record armed/input monitor enabled. (For both effect and instrument plugins.)

If I was doing a plugin that needed this, I guess I’d just have the requirement for the user to try the track record/input monitoring enabled if they wanted to use the audio file preview feature…

and, of course, the plugin would know if it’s processBlock was getting called, or not, and could reflect that though the GUI if the user was trying to audition.

Logic for instance is not calling on playback, if it is of type audio effect (aufx) unless there is already audio on the track, it is as generator (augn), which affects how it is presented, so it is not always an option.

I used the approach to audition through the normal AudioIODevice (i.e. AudioDeviceManager) in a productive plugin for FinalCutPro, which had no issues.

However there is no chance to route this audition to a specific bus inside the host.

Many thanks for the replies. It seems clear that some DAWS won’t send the audio out, so I’ll at least have an option to use a regular audio port independent of the DAW, with the understanding that this won’t work in exclusive mode.