THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/01/2006 at 14:42, xxxxxxxx wrote:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C++ ;
i have a problem with loading sound with basesound class. i createred sound which is BaseSound pointer (as basesound doesn't seem to have a constructor o.O), but sound->load doesn't work... i think there must be something missing before load, but i can't find what... any help would be highly appreciated.
On 17/01/2006 at 22:26, xxxxxxxx wrote:
Like most C4D 'Base' classes, there are no direct constructor/destructor methods. You must use 'Alloc' and 'Free' to allocated and free the class:
BaseSound* sound = BaseSound::Alloc();
Note that Load() only works with WAV sound files. It is possible that certain codecs are not supported (unless they are installed).
Here is working source that I use (in conjunction with animation tracks) :
if (type == Ssound)
if (!tokenReader.ParseBool(&fileReader;, &boolVal;, "on", "off")) return FALSE;
SoundSequence *sseq = static_cast<SoundSequence*>(seq);
if (!(bsound = sseq->GetSound()))
if (!tokenReader.ParseQuotedString(&fileReader;, &name;))
Filename soundFile = Filename(filename);
sseq->SetParameter(DescID(ID_SOUND_NAME), name, DESCFLAGS_DONTCHECKMINMAX);
else ErrorException::Throw(GeLoadString(ERROR_OPENFILE_TEXT), "Sound file:", name);
On 18/01/2006 at 03:41, xxxxxxxx wrote:
thanks, solved that, works ok now, but i got something really weird instead... I have a separate new class, in which sounddata pointer has to be created (because getsample needs pointer SData to work with), but it doesn't seem to work. Cinema throws "The instruction at "----" referenced memory at "----"..." error... it works if i declare wariable sd like SData sd; but doesnt with SData* sd=new SData();... that one works just fine in the main plugin cpp (NodeData::Message) though... any ideas?
thanks in advance,
On 18/01/2006 at 07:44, xxxxxxxx wrote:
ah, found it out myself. in the end it had nothing to do with the sdata