GitXplorerGitXplorer
s

android-tone-generator

public
7 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
33bb972771e42b0f4f629ffdff53561d53be812a

fail fast

committed 5 years ago
Unverified
0a025d656f268e69d20ddc555bcfb9f5b9252916

Merge branch 'master' of https://github.com/stefanhaustein/atg

sstefanhaustein committed 5 years ago
Unverified
197a6f5ab27f9c2dbcc00caf36075043855b40fa

rm debug prin

sstefanhaustein committed 5 years ago
Verified
3c207ee80b8ded443450e99d9ed535c403c491ba

Update README.md

sstefanhaustein committed 5 years ago
Verified
e7b770f12a173a943b9e4f2098907013002a3448

Update README.md

sstefanhaustein committed 5 years ago
Unverified
fe6cc0b1af61d1a74da7625d229c1e5f2ea66371

 Replace prepare with setDelay()

sstefanhaustein committed 5 years ago

README

The README file for this repository.

Android Tone Generator

A simple single-file (<300LOC) tone generator library for Android >= 21.

Minimal example playing a middle A (440Hz) tone for 1000ms:

new ToneGenerator().play(440, 1000);

The API works by generating a single wave and then filling a minimal sample with copies. This is then looped for the desired time. If no length is provided, the tone will play until end() is called on the object returned from play. The ToneGenerator API provides means to set the envelope and waveform.

The Android 21 AudioTrack API provides a call to control the volume, allowing to support a sound envelope that is not encoded int the data. Without being able to fade the sound in and out, there may be audible artifacts at the beginning and end of the tone.