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 = new EuTxManager();
- Kotlin
val mTxManager = EuTxManager()
- Use euInitTransmit method, enter the data you want to transmit.
- Java
mTxManager.euInitTransmit("Hello, Euphony");
- Kotlin
mTxManager.euInitTransmit("Hello, Euphony")
- With process method, set how many times to repeat the sound(data). (-1 is infinite)
- Java
mTxManager.process(-1);
- Kotlin
mTxManager.process(-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 = new EuRxManager();
- Kotlin
val mRxManager = EuRxManager()
- 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