C# Class Nanook.TheGhost.WavProcessor

ファイルを表示 Open project: Nanook/TheGHOST

Public Methods

Method Description
ChangeFsbInternalFilename ( string fsbFilename, string internalFilename ) : void

Converts all found wav files for the songQbKey passed on contruction to FSB format.

CombineAudio ( float volume, string dstFilename ) : void
CreatePreview ( int offset, int length, int fade, float volume, bool volumeApplied, string dstFilename ) : void
CreateSilentWav ( int length, string dstFilename ) : void
CreateSilentWav ( int length, string dstFilename, bool stereo, int samplesPerSec ) : void
FilesEqual ( string fileA, string fileB ) : bool

test 10 1k chunk from random parts of the files

FixWavHeader ( Stream wavStream ) : WavSingleChunkHeader
IsWavSilent ( string filename, float tolerence ) : bool

Test for silent wavs

Normalize ( string filename, bool halfVolume ) : void
ParseWavSingleChunkHeader ( Stream wavStream ) : WavSingleChunkHeader
PlayWav ( string wavFilename, SoundFlags soundFlags ) : void
SetLengthSilenceAndVolume ( float silenceInsertLength, float maxLength, float volume, string fileName ) : void

Adds silence to wav files alter volume

StopWav ( ) : void
Truncate ( string filename, float lengthMs ) : void
WriteSingleChunkHeader ( WavSingleChunkHeader header, Stream wavStream ) : void

Private Methods

Method Description
PlaySound ( string pszSound, IntPtr hMod, SoundFlags sf ) : bool

Method Details

ChangeFsbInternalFilename() public method

Converts all found wav files for the songQbKey passed on contruction to FSB format.
public ChangeFsbInternalFilename ( string fsbFilename, string internalFilename ) : void
fsbFilename string
internalFilename string
return void

CombineAudio() public static method

public static CombineAudio ( float volume, string dstFilename ) : void
volume float
dstFilename string
return void

CreatePreview() public static method

public static CreatePreview ( int offset, int length, int fade, float volume, bool volumeApplied, string dstFilename ) : void
offset int
length int
fade int
volume float
volumeApplied bool
dstFilename string
return void

CreateSilentWav() public static method

public static CreateSilentWav ( int length, string dstFilename ) : void
length int
dstFilename string
return void

CreateSilentWav() public static method

public static CreateSilentWav ( int length, string dstFilename, bool stereo, int samplesPerSec ) : void
length int
dstFilename string
stereo bool
samplesPerSec int
return void

FilesEqual() public static method

test 10 1k chunk from random parts of the files
public static FilesEqual ( string fileA, string fileB ) : bool
fileA string
fileB string
return bool

FixWavHeader() public static method

public static FixWavHeader ( Stream wavStream ) : WavSingleChunkHeader
wavStream Stream
return WavSingleChunkHeader

IsWavSilent() public static method

Test for silent wavs
public static IsWavSilent ( string filename, float tolerence ) : bool
filename string input raw wav
tolerence float 0=0% to 1=1%
return bool

Normalize() public static method

public static Normalize ( string filename, bool halfVolume ) : void
filename string
halfVolume bool
return void

ParseWavSingleChunkHeader() public static method

public static ParseWavSingleChunkHeader ( Stream wavStream ) : WavSingleChunkHeader
wavStream Stream
return WavSingleChunkHeader

PlayWav() public static method

public static PlayWav ( string wavFilename, SoundFlags soundFlags ) : void
wavFilename string
soundFlags SoundFlags
return void

SetLengthSilenceAndVolume() public static method

Adds silence to wav files alter volume
public static SetLengthSilenceAndVolume ( float silenceInsertLength, float maxLength, float volume, string fileName ) : void
silenceInsertLength float Milliseconds to insert at start of wav
maxLength float If the wav is longer than this then crop (includes silence), if 0 then don't crop
volume float 0=silent, 1=100%
fileName string
return void

StopWav() public static method

public static StopWav ( ) : void
return void

Truncate() public static method

public static Truncate ( string filename, float lengthMs ) : void
filename string
lengthMs float
return void

WriteSingleChunkHeader() public static method

public static WriteSingleChunkHeader ( WavSingleChunkHeader header, Stream wavStream ) : void
header WavSingleChunkHeader
wavStream Stream
return void