Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7954531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:27:22+00:00 2026-06-04T03:27:22+00:00

Trying to use code from here Im trying to incorporate both classes so that

  • 0

Trying to use code from here
Im trying to incorporate both classes so that I end up with an inputStream of ulaw audio data. So I have editted UlawEncoderInputStream like so:

private MicrophoneInputStream micIn;
public UlawEncoderInputStream() {
    mMax = 0;
    try {
            micIn = new MicrophoneInputStream(8000, 1);

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
}

Then attempt to use that UlawEncoderInputStream:

while(transmittingAudio) {
                        if(micInStream.available()>0) {
                            //              byte[] data = new byte[audioDump.available()];
                            int bytesRead = micInStream.read(data);
                            os.write(data,0,bytesRead);
                            os.flush();
                            //              ca.transmitAxisAudioPacket(data);
//                          System.out.println("read "+bytesRead);
                        }

However there seems to be a problem with the JNI native statement at the bottom of MicrophoneInputStream.

private static native int AudioRecordNew(int sampleRate, int fifoDepth);

Errors with this:

05-14 14:46:48.544: W/dalvikvm(28658): No implementation found for
native Lcom/avispl/nicu/audio/MicrophoneInputStream;.AudioRecordNew
(II)I

05-14 14:46:48.552: W/dalvikvm(28658): threadid=10: thread exiting
with uncaught exception (group=0x40018560)

05-14 14:46:48.552: E/AndroidRuntime(28658): FATAL EXCEPTION:
Thread-12

05-14 14:46:48.552: E/AndroidRuntime(28658):
java.lang.UnsatisfiedLinkError: AudioRecordNew

05-14 14:46:48.552: E/AndroidRuntime(28658): at
com.avispl.nicu.audio.MicrophoneInputStream.AudioRecordNew(Native
Method)

05-14 14:46:48.552: E/AndroidRuntime(28658): at
com.avispl.nicu.audio.MicrophoneInputStream.(MicrophoneInputStream.java:27)

05-14 14:46:48.552: E/AndroidRuntime(28658): at
com.avispl.nicu.audio.UlawEncoderInputStream.(UlawEncoderInputStream.java:111)

05-14 14:46:48.552: E/AndroidRuntime(28658): at
com.avispl.nicu.audio.AudioTransmitter.run(AudioTransmitter.java:66)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:27:23+00:00Added an answer on June 4, 2026 at 3:27 am

    Excuse me if this is far below the level of the question your asking, I’m tired and I’m finding your question hard to understand:

    If you are trying to call the native method AudioRecordNew

    You will need to do a static { System.loadLibrary("cLibraryName"); } to load the native library you construct using android-ndk \ Android.mk \ Application.mk

    and your c++ file (and h file) will need a method like so:

    JNIEXPORT void JNICALL Java_com_company_package_JavaFile_AudioRecordNew(JNIEnv* env, jobject obj, jint arg0, jint arg1)     
    {
    
    }
    

    Unless you have a native library which does all of the above, you’ll get an error telling you the native library doesn’t exist. (Which looks like the problem you have here, you don’t have the java native library used in the example).

    If you can get the source code for the native library however you can follow the above to build an android version of the library and keep going.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use DirectSound to capture sound from a microphone. Here's my code:
I have been trying to use the hibernate dialect for SQLite from http://code.google.com/p/hibernate-sqlite/ in
I'm trying to use the geocoding code from here in my ASP.NET MVC 2
I'm trying to use the Sending a basic message code from here to send
I'm trying to use a component I downloaded from code project ( here's the
I am trying to use the code from Microsoft for an Async Socket connection.
I'm trying to use Qt to download the html code from the following url:
I'm trying to convert some code from Richfaces 4 showcase to use CDI instead
I'm trying to use some code like this, and it's failing: data = Range(A1)
I'm trying to use the jQuery validation plugin (from here --> http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.