Audiofile
Posted: 05 May 2025, 19:33
Hi,
I'm trying to use the "audiofile" class in the SDK to make a multitrack file but I get some errors :
My idea is to have a multitrack wave file that I can save (or load) and populate it with samples
But I think I get something wrong.
If I want to have a recorder like the "audios ampler recorder" module, do I have to save the samples in a buffer (RAM) and then use the audiofile to save the wave file to disk ?
I'm a bit lost in here.
in .h
TAudioFilePtr audiofile1;
in .cpp
// constructor
multitrackrecorder::multitrackrecorder()
{
audiofile1 = sdkCreateAudioFile();
}
....
//-----------------------------------------------------------------------------
// initialisation
void multitrackrecorder::onInitModule (TMasterInfo* pMasterInfo, TModuleInfo* pModuleInfo)
{
sdkSetChannelsAudioFile(audiofile1, numOfAudiotInsOuts);
sdkSetSizeAudioFile(audiofile1, 60 * sdkGetSampleRate());
}
When loaded in Usine, I get those error messages :
[4] Error :
bad pointer in SetChannelsAudioFile
[6] Error :
bad pointer in SetSizeAudioFile
any idea ?
thanks
I'm trying to use the "audiofile" class in the SDK to make a multitrack file but I get some errors :
My idea is to have a multitrack wave file that I can save (or load) and populate it with samples
But I think I get something wrong.
If I want to have a recorder like the "audios ampler recorder" module, do I have to save the samples in a buffer (RAM) and then use the audiofile to save the wave file to disk ?
I'm a bit lost in here.
in .h
TAudioFilePtr audiofile1;
in .cpp
// constructor
multitrackrecorder::multitrackrecorder()
{
audiofile1 = sdkCreateAudioFile();
}
....
//-----------------------------------------------------------------------------
// initialisation
void multitrackrecorder::onInitModule (TMasterInfo* pMasterInfo, TModuleInfo* pModuleInfo)
{
sdkSetChannelsAudioFile(audiofile1, numOfAudiotInsOuts);
sdkSetSizeAudioFile(audiofile1, 60 * sdkGetSampleRate());
}
When loaded in Usine, I get those error messages :
[4] Error :
bad pointer in SetChannelsAudioFile
[6] Error :
bad pointer in SetSizeAudioFile
any idea ?
thanks