Author Topic: Saving CartChunk data  (Read 477 times)

Chris Reeve

  • Guest
Saving CartChunk data
« on: 4 Nov '23 - 16:43 »
Hi,

i've written code to retreive the cart chunk infrmation in a WAV file..and then added this code to update some values:

Code: [Select]
CartTag cart = (ManagedBass.CartTag)Marshal.PtrToStructure(tagpointer, typeof(ManagedBass.CartTag));

CartTimer timer2=new CartTimer();
        timer2.Usage=1;
        timer2.Value=1;
        cart.PostTimer[0]=timer2;

I can't see what i need to do next to write the updated meta back to the file. Is there a cart.save() or something similar ?

Ian @ un4seen

  • Administrator
  • Posts: 26019
Re: Saving CartChunk data
« Reply #1 on: 6 Nov '23 - 14:50 »
Unfortunately, BASS doesn't currently include support for tag writing, only reading. So you would need to use a third-party tagging library for that, or do it yourself if you're familiar with the RIFF/WAVE file format in this case. If your changes don't affect the size of the existing "cart" chunk then it should be fairly straightforward to write them to the file (if the size is changed then you may need to shift other chunks too depending on where the "cart" chunk is located).