Logo

official euphony library page.

View the Project on GitHub euphony-io/euphony

Intro


travis_ci Coverage Status License
Euphony is a handiness library designed to communicate with other devices using mic & recorder.
Euphony.js is based on Web Audio API. Below list is available.

Demo


When you click to broadcast button, data sound will be generated. Then, you can see the result using Android Receiver Demo.

Usage


We currently support Java & Kotlin & Javascript for Android & Web :)

For web browser

1) Prerequisite

<script src='https://cdn.jsdelivr.net/gh/euphony-io/euphony.js/dist/euphony.m.min.js'></script>

<!-- if you want to use module version of euphony, import this like below.
<script type='module'>
    import {Euphony} from "https://cdn.jsdelivr.net/gh/designe/euphony.js/dist/euphony.m.min.js";
</script>
-->

2) Generate acoustic sound!

var euphony = new Euphony(); // initialize
euphony.setCode("Hello, Euphony!"); 
// set the message to transmit
euphony.play();

it is only now offering transmitter version.

For Android

1) Prerequisite

// AndroidManifest.xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />

// build.gradle in app module
dependencies {
    implementation 'euphony.lib:euphony:0.7.1.6'
}

2) Enjoy the euphony library!

in Transmitter

EuTxManager mTxManager = new EuTxManager();
mTxManager.euInitTransmit("Hello, Euphony"); // To generate acoustic data "Hello, Euphony"
mTxManager.process(-1); // generate sound infinite.

in Receiver

EuRxManager mRxManager = new EuRxManager();
mRxManager.setAcousticSensor(new AcousticSensor() {
@Override
    public void notify(String letters) {
        //when data is received
    }
});

mRxManager.listen();  //Listening Start
// if you want to finish listening, call the finish();
// mRxManager.finish();

That’s all!