How to mix or append several sounds in one single shot |
|
An important feature for a sound editor control is the capability to mix or append in one single shot several sounds, coming from different sources, thus allowing the development of applications capable of managing multitrack sessions as seen inside Adobe® Audition® .
Audio Sound Editor API brings two different features that allow the creation and management of multitrack session:
• | Mixing automation |
With this feature you can add a certain number of source sounds (items) to an automation list that will be used to mix all of them into a final sound. For each item added to the automation list you can define the following characteristics:
• | the source from which the sound will be taken: it could be a sound file stored on disk, another instance of the API or an instance of Audio Sound Recorder API for .NET |
• | the range of interest within the source: for example you could decide to mix only from second 10 to second 50 of the source sound. |
• | the volume applied to the source sound during the mixing operation |
• | the position, inside the destination sound, where the mixing will occur: if for example you have an empty session and you add a single item, having a mixing position of 20 seconds, to the automation list, when the mixing automation will be executed you will obtain a destination sound with 20 seconds of silence at the beginning |
A new item can be added to the automation list through the MixAutomationItemAddFromFile (adds a sound stored on the hard disk), MixAutomationItemAddFromFileRaw (adds a sound in RAW format stored on the hard disk), MixAutomationItemAddFromEditor (adds a sound stored inside an instance of Audio Sound Editor) and MixAutomationItemAddFromRecorder (adds a sound stored inside an instance of Audio Sound Recorder) methods.
Once all desired items have been added to the list, you can start the mixing automation session through the MixAutomationExecute method: during the execution of the mixing automation session the container application is notified about current advancement through the CallbackPercentage delegate set through the CallbackPercentageSet method.
As for any other editing session, the edited sound can be exported into a file through the ExportToFile method.
As you can imagine, an important feature is the capability to have several instances of Audio Sound Editor API each of them having a different loaded sound: on each sound you can apply different effects or volume settings and, when all sounds have been edited, you can mix all of them into the destination sound at different mixing positions. For example, you could have an instance containing the drums track, another instance containing the guitar track and a third instance containing the voice track: by mixing all of them together you would obtain a song with drums, guitar and voice all mixed together at desired positions.
• | Append automation |
With this feature you can add a certain number of source sounds (items) to an automation list that will be used to append all of them into a final sound. For each item added to the automation list you can define the following characteristics:
• | the source from which the sound will be taken: it could be a sound file stored on disk, another instance of the API or an instance of Audio Sound Recorder API for .NET |
• | the range of interest within the source: for example you could decide to mix only from second 10 to second 50 of the source sound. |
• | the volume applied to the source sound during the mixing operation |
A new item can be added to the automation list through the AppendAutomationItemAddFromFile (adds a sound stored on the hard disk), AppendAutomationItemAddFromFileRaw (adds a sound in RAW format stored on the hard disk), AppendAutomationItemAddFromEditor (adds a sound stored inside an instance of Audio Sound Editor) and AppendAutomationItemAddFromRecorder (adds a sound stored inside an instance of Audio Sound Recorder) methods.
Once all desired items have been added to the list, you can start the append automation session through the AppendAutomationExecute method: during the execution of the append automation session the container application is notified about overall advancement through the CallbackPercentage delegate set through the CallbackPercentageSet method; furthermore, for each appended sound file, the container application is notified about file's loading advancement through the CallbackAppendAutomationFilePerc delegate set through the CallbackAppendAutomationFilePercSet method.
As for any other editing session, the edited sound can be exported into a file through the ExportToFile method.
A typical application for this feature could be the dynamic composition of sentences made up of several words, each contained inside a different sound file.
Samples of usage for append and mixing automation sessions in Visual C# and Visual Basic.NET can be found inside the following samples installed with the product's setup package:
- AppendAutomation (available also in Unmanaged Visual C++)
- ConcatenateSounds (available also in Unmanaged Visual C++)
- MixAutomation (available also in Unmanaged Visual C++)