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.
- Transmitter
- Generate sound waves and transmits through a speaker.
- Receiver
- Listen to sound waves and receive data through a MIC.
- Create EuTxManager object which turns data into sound waves.
- Java
EuTxManager mTxManager = EuTxManager.getInstance();
- Kotlin
val mTxManager = EuTxManager.getInstance()
- Use setCode method, enter the data you want to transmit.
- Java
mTxManager.setCode("Hello, Euphony");
- Kotlin
mTxManager.setCode("Hello, Euphony")
- With play method, set how many times to repeat the sound(data). (-1 is infinite)
- Java
mTxManager.play(-1);
- Kotlin
mTxManager.play(-1)
Requires permission of RECORD_AUDIO
- Write in AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
- Create EuRxManager object that receives sound waves as data
- Java
EuRxManager mRxManager = EuRxManager.getInstance();
- Kotlin
val mRxManager = EuRxManager.getInstance()
- 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
}
- Start receiving sound waves
- Java
mRxManager.listen(); // Listening Start
- Kotlin
mRxManager.listen() // Listening Start
- End sound wave reception
- Java
mRxManager.finish(); // Listening finish
- Kotlin
mRxManager.finish() // Listening finish