Skip to content

Commit 74833e5

Browse files
author
Ergin Turk
committed
Add rollup integration with commonjs and module support
1 parent 0e36ab5 commit 74833e5

File tree

6 files changed

+570
-1313
lines changed

6 files changed

+570
-1313
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@ npm install pixeltone.js
2222

2323
After installing, you can import and use **PixelToneJS** in your project:
2424

25-
import { processSound } from 'pixeltone.js';
2625

27-
### Example usage
26+
### Example ESModule usage
2827
```typescript
2928
import { processSound } from 'pixeltone.js';
29+
processSound({ inputImagePath: 'input.png', outputAudioPath: 'output.wav' });
30+
```
3031

31-
const options = { inputImagePath: './path/to/image.png', outputAudioPath: './output/audio.wav', sampleRate: 44100, duration: 0.01, };
32-
33-
processSound(options) .then(() => console.log('Audio file created!')) .catch(err => console.error('Error:', err));
32+
### Example CommonJS usage
33+
```typescript
34+
const { processSound } = require('pixeltone.js');
35+
processSound({ inputImagePath: 'input.png', outputAudioPath: 'output.wav' });
3436
```
37+
3538
### Options
3639
- `inputImagePath`: Path to the input image (e.g., `./images/my-image.png`).
3740
- `outputAudioPath`: Path to save the output audio file (e.g., `./output/audio.wav`).

0 commit comments

Comments
 (0)