Skip to content

Commit

Permalink
updated changelog and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Feb 14, 2022
1 parent 4d226a8 commit 62f0ea2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
@@ -1,5 +1,10 @@
# Changelog

## 2.1.0 [14 Feb 2022]

- 🧹 Reworked API to allow providing custom Wave Generator
- ➕ Added `SquareWaveGenerator`

## 2.0.0 [14 Feb 2022]

- ✅ Switched to Kotlin
Expand Down
21 changes: 15 additions & 6 deletions docs/Readme.md
Expand Up @@ -23,9 +23,9 @@ val zenTone = ZenTone()

`ZenTone` accepts 3 arguments, each having a sensible default:

1. sampleRate: Int = 44100,
2. encoding: Int = AudioFormat.ENCODING_PCM_16BIT,
3. channelMask: Int = AudioFormat.CHANNEL_OUT_MONO
1. `sampleRate`: Int = 44100
2. `encoding`: Int = AudioFormat.ENCODING_PCM_16BIT
3. `channelMask`: Int = AudioFormat.CHANNEL_OUT_MONO

based on your requirement, you can pass a different value when instantiating `ZenTone` i.e

Expand All @@ -39,10 +39,19 @@ To start playing audio with a frequency and volume:
zenTone.play(frequency = 400f, volume = 2)
```

here
`play()` accepts 3 arguments:

- `400f` is frequency of type `Float`
- `2` is volume of type `Int`. It ranges from 0 to 100, where 0 is no audio and 100 is full volume.
1. `frequency`: Float
2. `volume`: Int. It ranges from 0 to 100, where 0 is no audio and 100 is full volume.
3. `waveByteArrayGenerator`: WaveByteArrayGenerator = SineWaveGenerator, here `SineWaveGenerator` is a sensible default.

based on your requirement, you can pass a different value when instantiating `ZenTone` i.e

```kt
zenTone.play(frequency = 440f,
volume = 10,
waveByteArrayGenerator = SquareWaveGenerator)
```

To stop playing audio:

Expand Down

0 comments on commit 62f0ea2

Please sign in to comment.