Previous Topic

Next Topic

Book Contents

Book Index

Home Page

How to Extract Sections of a Wave File

Some audio applications will require the ability to extract only portions of a wave file. Some applications of this feature include:

All of these scenarios can be handled with the ACCTools Audio Splicing Tool. This object is created using CreateObject("ACCTools.AudioSplicer").

The splicing object has a GetLength method which accepts the name of a wave file and returns the length of the audio file in seconds. Two other methods, ExtractBeginning and ExtractEnding allow the user to extract any number of seconds from the beginning or ending of the audio file. The three methods are as follows:

The following sample code shows how to extract the beginning and ending 1.5 seconds of an audio file:

Set obj = CreateObject("ACCTools.AudioSplicer")
MsgBox obj.GetLength(AppPath & "\Examples\Goodbye.wav")
obj.ExtractBeginning(AppPath & "\Examples\Start.wav", _
AppPath & "\Examples\Goodbye.wav", 1.5)
obj.ExtractEnding(AppPath & "\Examples\End.wav", _
AppPath & "\Examples\End.wav", 1.5)

The ExtractBeginning and ExtractEnding functions are very fast and will work well with even large wave files.

See Also

Advanced Audio Topics

How to Play a Sound File to the Speakers During a Call

How to Increase Volume of a Wave File through Scripting

How to Change Recording Silence Detection Levels

How to Enable Fast Forward/Rewind and Other Special Playback Features

How to Obtain Foreign Language and Other Speech Engines

How to Change Pronunciation for Text-to-Speech and Speech Recognition

How to Join Multiple Wave Files into One Wave File

How to Analyze and Compare Recorded Audio Data