UtilNAudioInsertSilence Method
Inserts a silence starting at a specific position in the source WaveStream.
Namespace: DevCase.ThirdParty.NAudioAssembly: DevCase.net48.ThirdParty.NAudio (in DevCase.net48.ThirdParty.NAudio.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IWaveProvider InsertSilence(
WaveStream wave,
TimeSpan startPosition,
TimeSpan duration
)
Public Shared Function InsertSilence (
wave As WaveStream,
startPosition As TimeSpan,
duration As TimeSpan
) As IWaveProvider
Dim wave As WaveStream
Dim startPosition As TimeSpan
Dim duration As TimeSpan
Dim returnValue As IWaveProvider
returnValue = UtilNAudio.InsertSilence(wave,
startPosition, duration)
public:
static IWaveProvider^ InsertSilence(
WaveStream^ wave,
TimeSpan startPosition,
TimeSpan duration
)
static member InsertSilence :
wave : WaveStream *
startPosition : TimeSpan *
duration : TimeSpan -> IWaveProvider
No code example is currently available or this language may not be supported.
- wave WaveStream
-
The source WaveStream.
- startPosition TimeSpan
-
The start position where to insert the silence.
- duration TimeSpan
-
The duration of the silence.
IWaveProvider
The resulting
IWaveProvider.
Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:
NAudio
This is a code example.
No code example is currently available or this language may not be supported.
Dim sourceFile As String = "C:\File.mp3"
Dim outputFile As String = "C:\Output.wav" ' It must be a WAVE file
Using reader As New AudioFileReader(sourceFile)
Dim position As TimeSpan = TimeSpan.Parse("00:00:01.500")
Dim duration As TimeSpan = TimeSpan.FromMilliseconds(1000)
Dim wave As IWaveProvider = InsertSilence(reader, position, duration)
WaveFileWriter.CreateWaveFile(outputFile, wave)
End Using
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.