Microphone signal ..source

by guruk » Tue, 01 Sep 2009 04:09:49 GMT


Sponsored Links
 Hi,
i look for a very simple example what signal arrives at my mic in
realtime.
It does not need to be saved to sd-card or anything.

Just a $vol=GetVolume   (0-xxxx)
$frequ=Getfrequ (0-28000)

something like that.

The Examples I found are just overloaded and mostly to record some
seconds to sd-card. I dont need that at all, just whats the signal
right
now arriving :)

thanks i advance

any snippet can help

chris
--~--~---------~--~----~------------~-------~--~----~



Microphone signal ..source

by Josh » Thu, 10 Sep 2009 09:14:18 GMT


 Im looking for the same thing? Can anyone help with this?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Microphone signal ..source

by Rud » Thu, 10 Sep 2009 11:19:45 GMT


 What you are asking for is a non-trivial problem. To determine the
frequency of a signal you have to capture a number of samples. Whether
they go to a memory buffer or SD is a detail. You then need to perform
a Fast Fourier Transform (or similar transform for the pedantic ones)
to determine the frequency. The more samples you collect the more
accurate the result. You need more samples to (1) make a more fine
grade determination of the frequency and (2) to increase the signal to
noise ratio.

Rud




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. problems building android dev environment?

Hey Fred,

First, thanks for the response.

1. You set Java Home to the actual folder instead of the sym link,



This is what I have:[...@android:~/r2]7% echo $JAVA_HOME
/usr/lib/jvm/java-1.5.0-sun
[...@android:~/r2]8%




Sure:


!SESSION 2009-09-03 09:36:05.787
-----------------------------------------------
eclipse.buildId=I20090611-1540
java.version=1.5.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product
org.eclipse.epp.package.java.product

!ENTRY org.eclipse.jdt.core 4 4 2009-09-03 09:39:44.025
!MESSAGE Invalid ZIP archive:
dalvik/libcore/luni/src/test/resources/tests/api/java/net/InvalidJar.jar [in
r2]
!STACK 1
org.eclipse.core.runtime.CoreException: I/O exception
    at
org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2425)
    at
org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:152)
    at
org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:78)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.initializePackageNames(JavaProjectElementInfo.java:252)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache(JavaProjectElementInfo.java:225)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:290)
    at
org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2241)
    at
org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2251)
    at
org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1279)
    at
org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1186)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:167)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:504)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:328)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.util.zip.ZipException: invalid END header (bad central
directory offset)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    at java.util.zip.ZipFile.<init>(ZipFile.java:234)
    at
org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2419)
    ... 29 more
!SUBENTRY 1 org.eclipse.jdt.core 4 -1 2009-09-03 09:39:44.028
!MESSAGE I/O exception
!STACK 0
java.util.zip.ZipException: invalid END header (bad central directory
offset)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    at java.util.zip.ZipFile.<init>(ZipFile.java:234)
    at
org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2419)
    at
org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:152)
    at
org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren(JarPackageFragmentRoot.java:78)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.initializePackageNames(JavaProjectElementInfo.java:252)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache(JavaProjectElementInfo.java:225)
    at
org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(JavaProjectElementInfo.java:290)
    at
org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2241)
    at
org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2251)
    at
org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1279)
    at
org.eclipse.jdt.internal.core.JavaProject.findType(JavaProject.java:1186)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:167)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:504)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:328)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.jdt.core 4 4 2009-09-03 09:40:28.110
!MESSAGE JavaBuilder handling ImageBuilderInternalException while building:
r2
!STACK 1
Java Model Exception: Java Model Status [A [in Main.java [in <default> [in
dalvik/tests/002-sleep/src [in r2]]]] does not exist]
    at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:492)
    at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:526)
    at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:252)
    at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:238)
    at org.eclipse.jdt.internal.core.Member.getNameRange(Member.java:316)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.createProblemFor(AbstractImageBuilder.java:397)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.acceptResult(AbstractImageBuilder.java:179)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:504)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
    at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:328)
    at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
    at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
    at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
    at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
    at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
    at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
    at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
    at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2009-09-03 09:40:28.110
!MESSAGE A [in Main.java [in <default> [in dalvik/tests/002-sleep/src [in
r2]]]] does not exist


Thnx,

Dave

--~--~---------~--~----~------------~-------~--~----~

2. horizontal center a linear layout....

i am trying to create some text like this:

+=======================+
|                                                |
|              Name: Fred                 |
|                                                |
+=======================+

and I want the combination of "Name: " and "Fred" to be horizontally
centered.  The "Fred" TextView can change:

        <LinearLayout android:orientation="horizontal"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:gravity="center_horizontal">

                <LinearLayout android:orientation="horizontal"
                              android:layout_width="fill_parent"
                              android:layout_height="wrap_content">

                        <TextView android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="Name: "
                                  android:paddingRight="4px"/>

                        <TextView android:id="@+id/Name"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="Fred"/>

                </LinearLayout>

        </LinearLayout>

But it doesn't center - what am I missing?

tia.
--~--~---------~--~----~------------~-------~--~----~

3. Location/GPS and SqlLite help needed

4. apk install error

5. Returning files through a Cursor

6. Can I leave some info after my app is uninstalled?

7. A way to get all apps and their activities?