GithubHelp home page GithubHelp logo

cameramic's Introduction

CameraMic

Camera & Microphone OpenFL native extension (for Android & iOS)

Features:

  • Native camera view to take a photo.
  • Native microphone access to record audio.
  • Recorded audio playback.

There is not any error handling yet. I know this is no a perfect way to do it, but at least it works for me! It would be great you help me doing it better.

Installation

Install the repository code using haxelib git:

haxelib git CameraMic https://github.com/josuigoa/CameraMic.git

Android

Android version works fine hacking GameActivity for the camera (the GameActivity file is in the test project). When OpenFL 1.1 is released, I hope I will do it cleaner. using the new OpenFL 1.1 Extension class

iOS

In the iOS version, the camera view pushes and takes the photo. Otherwise it seems it records audio correctly, but I can´t play it back, so I can't know if it is ok.

TODO

  • Move the images from the camera roll instead of copying

License

This software is released under the MIT License

cameramic's People

Contributors

josuigoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cameramic's Issues

ios build fails

I wanted to test your extension on ios, but it failed:
(The example code I used is from https://github.com/josuigoa/CameraMic/tree/master/test_project)

→ lime test ios 
Error: Source path "/usr/lib/haxe/lib/CameraMic/git/ndll/IPhone/libcameramic.iphoneos.a" does not exist

Which is correct, there is no IPhone-folder in ndll-folder.
There is probably a command that I need to execute to build that, but I don't know which one.

Licence?

Hey,

Firstly, thanks for sharing your project!

We were hoping to use your project in an app we are building but were wondering what the licensing was. We are making a couple of changes that we are hoping to share back and just wanted to check this was going to be possible before carrying on too much.

Eamonn

JNI Exception on Android

Hi,

I have an app where I've embedded recording inside one of many scenes, and I allow the user to change scenes by swiping left and right.

I noticed this workflow generates a crash:

  • Go to recording scene
  • Start recording (but don't stop recording)
  • Switch to another scene
  • Switch back to the recording scene
  • Start recording again

This is presumably because the recording device is already occupied. Since the class is static, it's not automatically destroyed when I change states.

Here's what the log files say:

could not get audio input for record source 1
audio source is not initialized
start failed: -2147483648
Java.lang.RuntimeException: start failed
at android.media.MediaReorder.native_start(Native Method)
...
JNI Exception

I assume the work-around for this is to store and detect if the user is recording, and if so, force a stop recording when the scene changes.

org.haxe.lime.GameActivity not found

Hello,

I'm trying to compile the test project. I have lime and lime-tools installed (also added them to application.xml). I'm getting the following error when trying to compile against android:

CameraMic.java:3: cannot find symbol
[javac] symbol : class GameActivity
[javac] location: package org.haxe.lime
[javac] import org.haxe.lime.GameActivity;
CameraMic.java:86: cannot find symbol
[javac] symbol : variable GameActivity
[javac] location: class cameramic.CameraMic
[javac] GameActivity.getInstance().startActivityForResult(i, CAMERA_PIC_REQUEST);
[javac] ^
[javac] CameraMicNew\project\bin\android\bin\src\cameramic\CameraMic.java:162: cannot find symbol
[javac] symbol : variable GameActivity
[javac] location: class cameramic.CameraMic
[javac] GameActivity.getInstance().registerExtension(CameraMic.getInstance());
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 3 errors

Any ideas?

Windows build fails (Flash)

I used to be able to build this on Flash. (The API doesn't work on Windows, which is fine.) Now, I get an error about a missing ndll/Windows file (don't recall which one).

I noticed there's no Windows directory in your repository, either. Is this something I need to fix locally or is a change required to the repository?

Unknown identifier: CameraMic

Hi,

I tried cloning your repository and building test_project, as well as importing it has a haxelib into another project. Whenever I compile, I get copies of this error:

Unknown identifier: CameraMic

I tried tweaking the CameraMic class to add a package name (eg. cm), but this didn't fix the problem either.

test_project silently fails

Hi,

I can't seem to get your test_project to build and run as a flash app. It just shows me a white screen.

I dug a bit into your code. It seems like this line, fairly early on in the initialization, causes the app to error out:

CameraMic.appFilesDirectory = "/cameraMicTest";

I tried replacing this with a Windows path to a real (empty) directory, but that didn't do anything. I dug a bit into your code, but didn't see any issues with your property setter.

Am I doing something wrong (again?) :)

App crash when photo is taken and ready to go back

Hi,

I tried your test project using android, its work perfectly for audio and camera (half part) as well but their is a problem, after taking photo it stores it in the app directory "cameraMicTest/images/" successfully. Also a copy been saved in the gallery. But when I tried to go back to app using attach icon in the camera. The app crashes every time, with message
"The application CameraMic_test (process test.josuigoa.cameramic) has topped unexpectedly. Please try again"

Compiler error with OpenFL 8.6.4

I tried compiling this on an app with the latest Flixel/Lime/OpenFL. OpenFL is version 8.6.4. I get this error:

C:/HaxeToolkit/haxe/lib/cameramic/git/CameraMic.hx:10: characters 7-23 : Type not found : openfl.utils.JNI

I believe I have the latest version of CameraMic from Git (not the one from haxelib).

Any idea how to fix this? I'm working on a kids app and recording audio is pretty central to the functionality I need.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.