Generate audio track from local wav file

hi all,

I tried to put an audio file to a track but i don’t know how to do that.
i got a file :

File outputDirectory = File("Wav_Files");
File outputFile= File(outputDirectory.getChildFile("audio1.wav"));

maybe getNextAudioBlock function can help me ?
can i use a buffer and fill it to generate audio in track (like the record function)
i just want to have my audio1.wav in a track in my DAW, to play or modify it.

any ideas?

Thanks you :slight_smile:

Can you please explain a bit better/differently what you want to do? I don’t really understand from your explanation so far…

Sorry ^^

i have an audio plugin with a button. when i clicked on it, i want to “fill a track” with this file.

for example, if i have a “01-170405_1509.wav” in directory “C:\01-170405_1509.wav” on my local disk, i want this after button click :

maybe change buffer on processblock() function with new buffer containing file data?

thanks you :slight_smile:

That is not really possible to do with the standard plugin formats supported by Juce. (Reaper specifically has special support to do things like that but those features are not accessible from the standard Juce plugin code. And if you did use those special capabilities in Reaper, your plugin would not work the same on other hosts like Cubase or Ableton Live…)

The buffer you get with processBlock is just a small buffer containing audio from the host. It doesn’t really have anything directly to do with the audio on the track. (Think for example that there may be another plugin before your plugin and so on…Your plugin might also be inside a host that doesn’t even have audio tracks, like the Juce Plugin Host example or Max/MSP.)