1
1
# WaveFileManagerLibrary
2
- Using this library, you can create simple wave file quickly.
2
+
3
+ Using this library, you can quickly write code to create simple wave file.
3
4
4
5
## Description
5
6
@@ -13,25 +14,56 @@ If you want to use this on C#, you can download C# edition in the release page b
13
14
14
15
## Requirement
15
16
16
- This project depends on nothing.
17
+ This project depends on nothing (C++ edition)
18
+ This project depends on .NET framework or .NET Core (C# edtion)
17
19
18
20
## Usage
19
21
20
- If you want to make wavefile, you can do only following code with WaveFileManager.
22
+ I will show an example about this.
23
+ A detailed explanation about this can be seen on the site(Sorry, it's preparing now).
24
+
25
+ ### On C++
26
+
27
+ Following code with WaveFileManager works that create wave file.
21
28
``` C++
22
29
// #include "wavefile_manager.h"
23
30
24
31
// Declare variables
25
- WaveFileManager waveFile;
26
- MusicPropertyMonaural16bit prop16bit;
27
- short soundData[44100 * 2 ];
32
+ MusicProperty musicProperty;
33
+ WAVEFORMATEX format;
34
+ unsigned char data[44100 * 6 ];
35
+
36
+ // Generate sound data (C4 - 3 second)
37
+ generateSoundMonaural16bits (data, 44100 * 6, C4, 44100, 15000);
38
+
39
+ //Generate contents of WaveFile
40
+ generateWAVEFORMATEX(&format, MONAURAL_16BITS);
41
+ generateMusicProperty(&musicProperty, &format, MONAURAL_16BITS, data, 44100 * 6);
42
+
43
+
44
+ createFile("C:\\ capra.wav", &musicProperty);
45
+ ```
46
+
47
+ ### On C#
48
+
49
+ Following code with WaveFileManager works that create wave file.(This code behaves just like above code.)
50
+ ```C#
51
+ //using WFM;
52
+
53
+ //Declare variables
54
+ MusicProperty musicProperty = new MusicProperty();
55
+ WAVEFORMATEX format = new WAVEFORMATEX();
56
+ byte[] itibyou = new byte[44100 * 6];
57
+
58
+ //Generate sound data (C4 - 3 second)
59
+ WaveFileManager.GenerateSoundMonaural16bits(itibyou, Hertz.C4, 44100, 15000);
28
60
29
- // Generate sound data (440Hz)
30
- GenerateSoundMonaural16bits (soundData, 440 );
31
- prop16bit = GenerateMonaural16bits(soundData, 44100 * 2 );
61
+ //Generate contents of WaveFile
62
+ WaveFileManager.GenerateWAVEFORMATEX(ref format, EDataType.MONAURAL_16BITS );
63
+ WaveFileManager.GenerateMusicProperty(ref musicProperty, format, EDataType.MONAURAL_16BITS,itibyou );
32
64
33
65
//Create WaveFile
34
- waveFile .CreateFile("C:\\ capra.wav", prop16bit );
66
+ WaveFileManager .CreateFile("C:\\capra.wav", musicProperty );
35
67
```
36
68
37
69
## Install
0 commit comments