quiet / org.quietmodem.quiet Goto Github PK
View Code? Open in Web Editor NEWQuiet for Android - TCP over sound
Quiet for Android - TCP over sound
Hi,
I realise you have simple looking instructions to get this working. Do you have a working Android sample which demonstrates sending and receiving? It will boost library adoption rates.
Hi,
I am trying out this library and noticed - This only works when mic and speaker are just opposite of each other.
I checked out another app "S-Contact" (https://play.google.com/store/apps/details?id=com.totmob.scontact&hl=en") which works fairly well even at longer distance. One reason i can think of is sound produced by "S-Contact" app is louder than what produced by "Quiet".
Is there any way i can increase the volume of sound being produced by Quiet?
P.S: I tested both application on same phone and phone volume set at max level.
Any suggestion from you will really help me.
Error log
Executing tasks: [:quietmodule:generateDebugSources, :app:generateDebugSources]
:quietmodule:preBuild UP-TO-DATE
:quietmodule:preDebugBuild UP-TO-DATE
:quietmodule:compileDebugAidl NO-SOURCE
:quietmodule:compileDebugRenderscript UP-TO-DATE
:quietmodule:checkDebugManifest UP-TO-DATE
:quietmodule:generateDebugBuildConfig UP-TO-DATE
:quietmodule:generateDebugResValues UP-TO-DATE
:quietmodule:generateDebugResources UP-TO-DATE
:quietmodule:packageDebugResources UP-TO-DATE
:quietmodule:processDebugManifest UP-TO-DATE
:quietmodule:generateDebugRFile UP-TO-DATE
:quietmodule:prepareLintJar UP-TO-DATE
:quietmodule:generateDebugSources UP-TO-DATE
:app:checkDebugClasspath
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl NO-SOURCE
:quietmodule:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: D:\android\test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1223: error: duplicate value for resource 'attr/actionBarSize' with config ''.
D:\android\test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1223: error: resource previously defined here.
Command: C:\Users\zhuojun\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-beta04-4818971-windows.jar\f7b65d3b70ee55e203729b46f08e6b71\aapt2-3.2.0-beta04-4818971-windows\aapt2.exe compile --legacy \
-o \
D:\android\test\app\build\intermediates\res\merged\debug \
D:\android\test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.0-beta04-4818971-windows Daemon #0
Output: C:\Users\zhuojun\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.1.1.aar\4a0f66b2299a361d815291ce58fd531a\res\values\values.xml:108:5-6095: AAPT: error: duplicate value for resource 'attr/actionBarSize' with config ''.
C:\Users\zhuojun\.gradle\caches\transforms-1\files-1.1\appcompat-v7-23.1.1.aar\4a0f66b2299a361d815291ce58fd531a\res\values\values.xml:108:5-6095: AAPT: error: resource previously defined here.
Command: C:\Users\zhuojun\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-beta04-4818971-windows.jar\f7b65d3b70ee55e203729b46f08e6b71\aapt2-3.2.0-beta04-4818971-windows\aapt2.exe compile --legacy \
-o \
D:\android\test\app\build\intermediates\res\merged\debug \
D:\android\test\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.0-beta04-4818971-windows Daemon #0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
17 actionable tasks: 4 executed, 13 up-to-date
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.wave.test"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.0'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'com.google.android.material:material:1.0.0-alpha1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-alpha1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
implementation project(':quietmodule')
}
I'm looking for similar functionality in a Dart package for use in Flutter apps. Any plans to add support or pointers?
InputStream.available() will currently throw a generic IOException irrespective of there being bytes available to read from the input buffer
Information:Gradle tasks [:app:assembleDebug]
Error:error: typedef redefinition with different types ('__kernel_fd_set' vs 'struct fd_set')
/Users/niteesh/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/select.h
Information:(46, 3) previous definition is here
Error:error: typedef redefinition with different types ('u32_t' (aka 'unsigned int') vs '__socklen_t' (aka 'int'))
/Users/niteesh/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/types.h
Information:(116, 21) previous definition is here
Warning:warning: unused parameter 'env' [-Wunused-parameter]
Warning:warning: unused parameter 'reserved' [-Wunused-parameter]
Warning:warning: unused parameter 'env' [-Wunused-parameter]
Warning:warning: unused parameter 'klass' [-Wunused-parameter]
Warning:warning: unused parameter 'This' [-Wunused-parameter]
Error:Execution failed for task ':quiet:ndkBuild'.
Process 'command '/Users/niteesh/Library/Android/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 3.264 secs
Information:3 errors
Information:5 warnings
Information:See complete output in console
I've made a proof of concept app
I've tested with various quiet profiles but can't make it work reliably. It works occasionally with the phones spaced 30cm apart using the audible-7k-channel-0
profile. I've tested other profiles too without much success.
Is there an official demo app for org.quietmodem.Quiet?
Do you have any tips to make my app work better? I'm not sure if I'm using the API incorrectly or my expectations are too high.
Hi there! This is a wonderful library. I've gotten the C version to work reliably between two computers. I have also gotten the Android version to work between my phone and Genymotion. However, my final goal is to transmit a message from a computer to a phone. Here's what I tried:
Download the profiles from here (https://github.com/quiet/org.quietmodem.Quiet/blob/master/quiet/src/main/res/raw/quiet_profiles.json) into /usr/local/share/quiet/quiet-profiles.json.
Run quiet_encode_file audible-7k-channel-0 msg. I chose this profile because it's the one that I got working to transmit from Genymotion to my phone.
Just to test, I ran quiet_decode_file audible-7k-channel-0. It outputs the message as expected.
I'm running these commands in a virtual machine, so I decided to copy the encoded.wav file to my Windows host to play it from there. I play the file in Audacity, but my phone does not pick up the message (I'm using the QuietShare app). I tried to use the same volume and distance from the speaker that I use with Genymotion. It works every time with Genymotion but not with the encoded.wav file. I also ran quiet_decode_soundcard audible-7k-channel-0 in the virtual machine and it works perfectly when I play the encoded.wav file into the computer's microphone. It picks up the message every time.
So, I'm wondering? Are the C and Android versions of the library incompatible or does it have something to do with my setup? Thanks again! Great piece of work.
Brian -- I am trying to build quiet modem. I misread directions and installed current liquid-dsp on my Ubuntu 18.04 system. It compiled and tested well, but cmake for quiet said I had to switch to devel branch. The location specified was obsolete but I believe that the proper version could be obtained via:
git clone https://github.com/quiet/quiet-dsp.git
Is this correct? I cloned it and ./configure seems happy but make fails with gcc complaining about:
dotprod_cccf.mmx.c function 'dotprod_cccf_execute_mmx': …/pmmintrin.h:
inlining failed in call to always_inline '_mm_addsub_ps: target specific option mismatch.
This can be a nasty one to debug. Any thoughts? Steve
@brian-armstrong in the usage, I could not see the instance of NetworkInterface being used later. Also what is the significance of 169.254.255.255 ?
Hello Brian.
I have been playing with this lib for a couple of hours and I'm stuck with a bug. When the receiver activity is first started, the logcat would show:
W/AudioRecord: AUDIO_INPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, primary 48000 Hz
I/System.out: Read timeout
Subsequent start would show:
W/AudioRecord: AUDIO_INPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, primary 48000 Hz
E/AudioRecord: start() status -38
I/System.out: Read timeout
From what I understand, the microphone isn't initialized as per this stackoverflow thread, which results in error status -38. But what is causing the read timeout?
The attached is the source code. Thanks for any help.
Hi
I built Quiet successfully and added "quiet-debug.aar" to my app project. In addition, I added " compile project(':quiet-debug')" to "build.gradle".
When I compile my project its ok, but when I run it I get this error:
AndroidRuntime: FATAL EXCEPTION: main
Process: ..., PID: 14939
java.lang.NoSuchFieldError: No field abc_seekbar_tick_mark_material of type I in class Landroid/support/v7/appcompat/R$drawable; or its superclasses (declaration of 'android.support.v7.appcompat.R$drawable' appears in /data/app/net.ezlogin.ezloginapp-1/split_lib_dependencies_apk.apk:classes6.dex)
at android.support.v7.widget.AppCompatDrawableManager.(AppCompatDrawableManager.java:120)
at android.support.v7.widget.AppCompatDrawableManager.get(AppCompatDrawableManager.java:84)
at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:81)
at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:129)
at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:152)
at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:29)
at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:53)
at android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31)
at android.support.v7.app.AppCompatDelegateImplN.(AppCompatDelegateImplN.java:31)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:200)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:184)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:518)
at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:70)
at net.ezlogin.ezloginapp.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Im having one project which is developed in Android Studio 2.version now im going to update that software in Android Studio 3.2.1 im getting error like this
Output: E:\Barakah_ Admin\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:994: error: inner element must either be a resource reference or empty.
E:\Barakah_ Admin\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:995: error: inner element must either be a resource reference or empty.
E:\Barakah_ Admin\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:996: error: inner element must either be a resource reference or empty.
Command: C:\Users\INTEL.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\89a56138524b25ecc03a2abebe8ccfa7\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy
-o
E:\Barakah_ Admin\app\build\intermediates\res\merged\debug
E:\Barakah_ Admin\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
while i press the link it takes me to value.xml file in that i'm not able to edit that lines.
Please any one help me to solve this ISSUE...
I am sending 40 characters long string from webapp (queitjs) to android app (quiet android sdk). However I am receiving this string in parts of 32 and 8 characters. I have used code as stated in samples as below-
transmit.transmit(Quiet.str2ab(cryptogram));
final byte[] buf = new byte[BUFFER_SIZE];
private static final int TIEMOUT = 30;
private static final int BUFFER_SIZE = 1024;
while (keepListening) {
long recvLen = 0;
try {
recvLen = frameReceiver.receive(buf);
byte[] immutableBuf = java.util.Arrays.copyOf(buf, (int) recvLen);
String receivedText = new String(immutableBuf, Charset.forName("UTF-8"));
Log.d("quiet", "run: receivedText: " + receivedText);
I am trying to build my own library on top of this library. When running my tests, the native C libraries (e.g. libcomplex.so
, libfec.so
) will not load and I get the following error in Java:
java.lang.UnsatisfiedLinkError: /path/to/org.quietmodem.Quiet/quiet/build/libs/x86_64/libfec.so: /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.quietmodem.Quiet.QuietInit.init(QuietInit.java:15)
at org.quietmodem.Quiet.FrameTransmitterConfig.<clinit> (FrameTransmitterConfig.java:58)
...
Running ldd
on the precompiled libfec.so
yields this output:
$ ldd libfec.so
libfec.so: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
(On my system, the correct path for libc.so
is /lib/x86_64-linux-gnu/libc.so.6
)
Here's some details of my system:
$ uname -r
4.16.0-2-amd64
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Manually recompiling the libraries seems to resolve the problem. If you think this would be an appropriate solution, I am happy to send a PR with the recompiled libraries.
Right after importing in android studio 3.X.X
Error:Execution failed for task ':quiet:ndkBuild'.
Process 'command 'C:\Users\admin\AppData\Local\Android\Sdk\ndk-bundle/ndk-build.cmd'' finished with non-zero exit value 2[](
[]([](`buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "abc.com"
minSdkVersion 16
versionCode 3
versionName "1.3"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
res.srcDirs = ['src/main/res']
jniLibs.srcDirs = ['src/main/jniLibs']
jni.srcDirs = [] // This prevents the auto generation of Android.mk
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.android.support:appcompat-v7:26+'
compile 'com.android.support:design:26.+'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'
compile 'com.turbomanage.basic-http-client:http-client-android:0.89'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.google.code.gson:gson:2.3'
compile 'com.github.bluejamesbond:textjustify-android:2.1.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:multidex:1.0.0'
compile 'com.mattluedke:snowshoelib:1.0.4'
compile 'com.android.support:support-v4:26.+'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile('com.twitter.sdk.android:tweet-composer:1.0.3@aar') {
transitive = true;
}
compile 'de.hdodenhof:circleimageview:2.0.0'
compile project(':lib')
compile project(path: ':quiet')
compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
transitive = true;
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable = true
jniDebuggable = true
}
}
sourceSets { main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
} }
[`
[
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:23.0.0'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test:runner:0.5'
compile 'com.android.support:appcompat-v7:26+'
}
def getNdkDir() {
if (System.env.ANDROID_NDK_ROOT != null)
return System.env.ANDROID_NDK_ROOT
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkdir = properties.getProperty('ndk.dir', null)
if (ndkdir == null)
throw new GradleException("NDK location not found. Define location with ndk.dir in the local.prope" +
"rties file or with an ANDROID_NDK_ROOT environment variable.")
return ndkdir
}
def getNdkBuildCmd() {
def ndkbuild = getNdkDir() + "/ndk-build"
if (Os.isFamily(Os.FAMILY_WINDOWS))
ndkbuild += ".cmd"
return ndkbuild
}
task ndkBuild(type:Exec, description: "Compile JNI Sources") {
workingDir file('src/main')
commandLine getNdkBuildCmd()
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkLibsToJar
}
task ndkLibsToJar(type: Zip, dependsOn: 'ndkBuild', description: 'Create a JAR of the native libs') {
destinationDir new File(buildDir, 'libs')
baseName 'ndk-libs'
extension 'jar'
from(new File(buildDir, 'libs')) { include '**/*.so' }
into 'lib/'
})]
`](url)
These are my build gradle files for app and quiet module. Not getting how to resolve the issues.
Error:Gradle project ndkBuild.path is C:\Users\admin\Desktop\android Studio projects\New folder\stumb\stumb\app\src\main\jni\Android.mk but that file doesn't exist
Hi,
Will tried to receive the audio QR using the Asus device (Asus T00J) and the application is crashing.
OS : Android Version 5.0 (Lollipop)
Device Details : https://www.gsmarena.com/asus_zenfone_5_a500cg_(2014)-5952.php
The crash details from the log :
AUDIO_INPUT_FLAG_FAST denied by client
A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xa042c885 in tid 8138 (AudioRecord)
The code for receiving is
receiver.setBlocking(5, 0);
byte[] buf = new byte[1024];
try {
recvLen = receiver.receive(buf);
} catch (Exception e) {
e.printStackTrace();
}
We are getting the Fatal error from the JNI and unable to catch in the java.
Could you please help on solving this issue.
Is it possible to build the NDK code as part of the build process rather than just including the pre-built binaries?
Hi, i was trying QuietShare sample app on my phone, but when i open it, it show
error org.quietmodem.Quiet.ModemException: failed to initialize opensl recorder, opensl error code=0002
and on the logcat it show
11-20 15:54:59.759 31803-31843/no.birkett.quietshare E/libOpenSLES: Cannot create AudioRecorder: data sink must be in PCM format
11-20 15:54:59.759 31803-31843/no.birkett.quietshare E/libOpenSLES: Cannot create AudioRecorder: invalid source or sink
11-20 15:54:59.759 31803-31843/no.birkett.quietshare W/libOpenSLES: Leaving Engine::CreateAudioRecorder (SL_RESULT_PARAMETER_INVAL
i run on my Xiaomi Redmi 3 Pro with Cortex-A53 CPU and Android 5.1.1
I built an example app that runs on the Samsung Galaxy S5 but not the NextBit Robin. I assume this is because the Snapdragon 808 is not supported.
Hey,
i am trying to setup the quietshare app on android 4.0.4 and i got everything working except the receiver on the phone gives me the mentioned error. The code was build without any problems. Any idea, what i have to change to get the receiver working?
Thanks in advance and thanks for this great project!
Please upgrade the project gradle files compatible with the latest Android Studio version gradle version.
java.lang.RuntimeException:Unable to start activity ComponentInfo{com.example.asus.mytrain/com.example.mytrain.kotlin.ui.UdpTransmitActivity}: java.lang.RuntimeException: java.net.SocketException: failed set socket option
I download QuietShare sample , that no found TCP mode .
initFrameTransmissionConfig();
initNetwork();
private void initFrameTransmissionConfig() throws Exception {
transmitterConfig = new FrameTransmitterConfig(
this,
"audible-7k-channel-0");
receiverConfig = new FrameReceiverConfig(
this,
"audible-7k-channel-0");
conf = new NetworkInterfaceConfig(
receiverConfig,
transmitterConfig);
}
private void initNetwork() throws Exception {
intf = new NetworkInterface(conf);
}
once I call initNetwork() sound transmittion plays audio for min 3 times
Please check video for more clarification
issue_video.zip
Created a sample activity and implemented the LoopbackFrameReceiver, LoopbackFrameTransmitter. Then I connected my device to a speaker(via Bluetooth) and start the activity received data in the receiver.
I was expecting that no data will be detected as the volume was 0, but it detects how?
note - I am using the spectrum-analyze app to detect generated sound
sSend = new DatagramSocket(new InetSocketAddress("0.0.0.0", 3333));
// listen on 3334
sRecv = new DatagramSocket(new InetSocketAddress("0.0.0.0", 3334));
// don't block for more than 10 seconds
sRecv.setSoTimeout(10000);
// get broadcast permission
sSend.setBroadcast(true);
when using provided code example shown above, this exception is thrown.
03-13 15:15:12.516 28144-28144/example.proto.atp E/AndroidRuntime: FATAL EXCEPTION: main
Process: example.proto.atp, PID: 28144
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.net.SocketException: failed set socket option
at org.quietmodem.Quiet.DatagramSocket.nativeSetSoTimeout(Native Method)
at org.quietmodem.Quiet.DatagramSocket.setSoTimeout(DatagramSocket.java:215)
at example.proto.atp.MainActivity.broadcast(MainActivity.kt:125)
at example.proto.atp.MainActivity.onKeyDown(MainActivity.kt:229)
at android.view.KeyEvent.dispatch(KeyEvent.java:3322)
at android.app.Activity.dispatchKeyEvent(Activity.java:3155)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:403)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4954)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4916)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4451)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4504)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4470)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4603)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4478)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4660)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4451)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4504)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4470)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4478)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4451)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4504)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4470)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4636)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4805)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3035)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2571)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2562)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3012)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Hello there,
I simply don't understand how this lib works, the documentation isn't good, sorry. Is there any example/demonstration which can be run on both devices (sender, receive; in this case, both are phones).
I tried the given examples, Frame Mode ones worked, it run. But I couldn't send data between devices.
Now, I'm trying the TCP example and it always throws exception; java.net.NoRouteToHostException: No route to host.
Can you please help?
Hi Brian, I would like to create a new profile with 21000 frequency. Is it possible to create that? if yes, can you please guide me the steps to do that.
Thanks in advance.
Hello,
I want to send some text, continuously. So if I call transmitter.send(myData) in a timer task and run it continuously, will it work? Currently receiver is not picking the data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.