Hi!
A long time GoldWave customer, I have recently begun developing my plugin for GoldWave.
All I want to do is open audio file and add append additional sound to it.
I am using flag aChangesLength and have implemented Scan(), and Read() functions. How do I change length of audio now?
I don't see any direct way by which I can continue reading audio and keep modifying it. Any help? Am I missing something here?
Regards,
Suchit
http://www.Suchit-Tiwari.Org
http://www.codeproject.com/script/Artic ... rid=299328
Changing Audio Length in Effect Plugin
-
- Site Admin
- Posts: 4372
- Joined: Wed Mar 10, 2004 6:43 pm
- Location: St. John's, NL
- Contact:
Re: Changing Audio Length in Effect Plugin
When you call the source Read() function in your own Read() function, you'll eventually get zero samples returned (or less than the requested amount). At that point, you'd start filling the destination buffer with the audio you want to append. In the simplest case, you'd have something like:
In the world real case, you'd need to start appending audio when Read() returns less than the requested number of samples and return zero when there are no more samples to append. Be careful not to cause any buffer overruns when transitioning from the source audio to the new appended audio.
You do not need a Scan() function just to append samples.
Chris
Code: Select all
if ( source->Read( dest, samples ) == 0 ) // End of original source?
{
memcpy( dest, new_audio, samples * sizeof(audio) * channels )
return samples; // Return number of samples appended during this call
}
You do not need a Scan() function just to append samples.
Chris