Skip to content

Commit b639004

Browse files
committed
Update README.md
2 parents e106ab2 + ad18331 commit b639004

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 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.
34

45
## Description
56

@@ -13,25 +14,56 @@ If you want to use this on C#, you can download C# edition in the release page b
1314

1415
## Requirement
1516

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)
1719

1820
## Usage
1921

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.
2128
```C++
2229
//#include "wavefile_manager.h"
2330

2431
//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);
2860
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);
3264
3365
//Create WaveFile
34-
waveFile.CreateFile("C:\\capra.wav", prop16bit);
66+
WaveFileManager.CreateFile("C:\\capra.wav", musicProperty);
3567
```
3668

3769
## Install

0 commit comments

Comments
 (0)