UtilNAudioInsertFadeOut Method
Inserts a fade-out effect 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 InsertFadeOut(
WaveStream wave,
TimeSpan startPosition,
TimeSpan duration,
bool skipAudioAfterFadeOut
)
Public Shared Function InsertFadeOut (
wave As WaveStream,
startPosition As TimeSpan,
duration As TimeSpan,
skipAudioAfterFadeOut As Boolean
) As IWaveProvider
Dim wave As WaveStream
Dim startPosition As TimeSpan
Dim duration As TimeSpan
Dim skipAudioAfterFadeOut As Boolean
Dim returnValue As IWaveProvider
returnValue = UtilNAudio.InsertFadeOut(wave,
startPosition, duration, skipAudioAfterFadeOut)
public:
static IWaveProvider^ InsertFadeOut(
WaveStream^ wave,
TimeSpan startPosition,
TimeSpan duration,
bool skipAudioAfterFadeOut
)
static member InsertFadeOut :
wave : WaveStream *
startPosition : TimeSpan *
duration : TimeSpan *
skipAudioAfterFadeOut : bool -> IWaveProvider
No code example is currently available or this language may not be supported.
- wave WaveStream
-
The source WaveStream.
- startPosition TimeSpan
-
The position where to insert the fade-out effect.
- duration TimeSpan
-
The duration of the fade-out effect.
- skipAudioAfterFadeOut Boolean
-
If , any leading audio after the fade-out effect position
will be skipped (cutted) from the source WaveStream.
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:05.000")
Dim duration As TimeSpan = TimeSpan.FromSeconds(3)
Dim wave As IWaveProvider = InsertFadeOut(reader, position, duration, skipAudioAfterFadeOut:=True)
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.