Skip to content

Latest commit

 

History

History
130 lines (90 loc) · 2.12 KB

GETTING_STARTED.md

File metadata and controls

130 lines (90 loc) · 2.12 KB

Getting Started

English | 한글

Euphony is a library that transmits data using critical bandwidths of the tonal frequency inaudible to humans.
Since the API is written in Java, users can use it in any language running on JVM like Java or Kotlin.

This consists of two parts.

  1. Transmitter
  • Generate sound waves and transmits through a speaker.
  1. Receiver
  • Listen to sound waves and receive data through a MIC.

in Transmitter


Generate sound waves and transmits though a microphone.

  1. Create EuTxManager object which turns data into sound waves.
  • Java
EuTxManager mTxManager = EuTxManager.getInstance();
  • Kotlin
val mTxManager = EuTxManager.getInstance()
  1. Use setCode method, enter the data you want to transmit.
  • Java
mTxManager.setCode("Hello, Euphony");
  • Kotlin
mTxManager.setCode("Hello, Euphony")
  1. With play method, set how many times to repeat the sound(data). (-1 is infinite)
  • Java
mTxManager.play(-1);
  • Kotlin
mTxManager.play(-1)

in Receiver


Part of receiving sound waves.

Requires permission of RECORD_AUDIO

  • Write in AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
  1. Create EuRxManager object that receives sound waves as data
  • Java
EuRxManager mRxManager = EuRxManager.getInstance();
  • Kotlin
val mRxManager = EuRxManager.getInstance()
  1. Listener settings that receive and process sound waves
  • Java
mRxManager.setAcousticSensor(new AcousticSensor() {
	@Override
	public void notify(String letters) {
		// when data is received
	}
});
  • Kotlin
mRxManager.acousticSensor = AcousticSensor { letters ->
	//when data is received
}
  1. Start receiving sound waves
  • Java
mRxManager.listen(); // Listening Start
  • Kotlin
mRxManager.listen() // Listening Start
  1. End sound wave reception
  • Java
mRxManager.finish(); // Listening finish
  • Kotlin
mRxManager.finish() // Listening finish