plug and script and mac os ventura on intel

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
can't get any other audio file to work with the file wav player example other than audio.wav provided even when i put in full path to file in the same folder as audio.wav. what am i doing wrong or any help? it just says Error: failed to initialize script but the ui loads.

Code: Select all (#)

#include "../library/WaveFile.hxx"

string name="Sample Player1";
string description="Plays an audio sample loaded from the script data folder (sample script).";

array<string> inputParametersNames={"Play"};
array<double> inputParameters(inputParametersNames.length);
array<double> inputParametersMin={0};
array<double> inputParametersDefault={0};
array<double> inputParametersMax={1};
array<int>    inputParametersSteps={2};
array<string>  inputParametersEnums={"Pause;Play"};

WaveFileReader  wavReader;
uint            channelsToPlay=0;
bool            playing=true;
bool initialize()
{
    // load sample file
	
    string filePath= "/Users/eoinodowd/Desktop/plugin/sample/haha.wav"; // but replacing haha.wav with audio.wav works
	print(filePath);
    bool ok=wavReader.openFile(filePath,audioOutputsCount);
    if(ok)
    {
        channelsToPlay=wavReader.channelsCount;
        if(channelsToPlay>audioOutputsCount)
            channelsToPlay=audioOutputsCount;
    }
    return ok;
}

void processSample(array<double>& ioSample)
{
    if(playing)
    {
        // read samples
        wavReader.readSample(ioSample);

        // silence unused channels
        for(uint ch=channelsToPlay;ch<audioOutputsCount;ch++)
        {
            ioSample[ch]=2;;
        }   
    }

    // loop back to beginning if end of file was reached
    if(wavReader.isEndOfFile())
        wavReader.setPos(0);
}

void updateInputParameters()
{
    playing=(inputParameters[0]!=0);
}

int getTailSize()
{
    // infinite tail, as we generate audio data whatever the input
    return -1;
}

Post

The provided Wavefile library is pretty basic, so it is likely that you are using an unsupported wav file format. If I remember well, it will only load PCM data, either as 16/24 bits integer or 32-bit floating point formats.

Post Reply

Return to “Blue Cat Audio”