Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Another microphone plugin issue — Gideros Forum

Another microphone plugin issue

saeyssaeys Member
edited September 2016 in Plugins
This microphone plugin is obviously haunting me...
I had a perfectly working microphone in my project (as well as in the provided example project). Had to do a system restore (after a HDD crash), new fresh Gideros 2016.8.1 install, and the microphone.dll is in the right place.
Now when running either of the projects in Gideros player I get this: (output from example project)
main.lua:9: attempt to index local 'microphone' (a nil value)
stack traceback:
	main.lua:9: in main chunk
The lines looks like this:
1   require "microphone"
2
3   local levelMeter = LevelMeter.new()
4   stage:addChild(levelMeter)
5   levelMeter:setY(30)
6
7   local microphone = Microphone.new(nil, 22050, 1, 16)
8  
9   microphone:addEventListener(Event.DATA_AVAILABLE, function(event)
10 	print("*")
11 	levelMeter:setLevel(event.peakAmplitude)
12  end)
13
14  microphone:setOutputFile("|D|record.wav")
The dll and module is obvously loaded, but I think something's gone wrong with Microphone.new(). What's going on?

I don't know what will happen after Android (or IOS) export, I'm not sure if I dare to try...

Comments

  • Did a win desktop export, microphone.dll correctly ends up in export folder/Plugins. Same error when run. :(
  • Solved it. Apparently I had to have something plugged in into line-in (or mic-in, presumably) on the computer. I guess otherwise Microphone.new() can't get deviceName and its variable becomes nil.
  • hgy29hgy29 Maintainer
    Glad you solved it :) I would never have thought of something like this...

    Likes: saeys

    +1 -1 (+1 / -0 )Share on Facebook
  • john26john26 Maintainer
    Hmm, I guess it could give a more helpful error...

    Also, could you test the microphone plugin using win32 export. We just added that recently in 2016.8.2 so nice to see if it works!
  • saeyssaeys Member
    edited September 2016
    Also, could you test the microphone plugin using win32 export. We just added that recently in 2016.8.2 so nice to see if it works!
    @John26 Let me get back to you - I'm still on 2016.8.1.

    Does anybody get the mic plugin to work on iOS? I get the usual "module 'microphone' not found" error when running the app from xcode (haven't tried Gideros player). @pie?
  • @john26 2016.8.2 win32 plugin export is working just fine.

    On the mac I can see the plugins list (after having moved the All plugins folder to Gideros studio/Contents) but no mic plugin files (.mm or .cpp) are copied into the exported Plugins folder. Naturally, when run through xcode the app doesn't find the microphone module and stops at splash screen.

    If I manually copy the plugins files to the exported Plugins folder I get the same error. (Sorry for repeating myself) Do I have to tell xcode to load the library (like in Android studio)? Or is it a permissions issue?
  • Solved: >:D<

    1. All 5 microphone/source/iOS/ files
    gmicrophone-ios.mm
    gmicrophone.h
    gmicropohnebinder.cpp
    gsoundencoder-wav.cpp
    gsoundencoder.h
    need to be in the exported project Plugins folder.
    2. In Xcode, File › Add files to..., add all those 5 files to the project. I guess they should be placed in the Plugins folder in the project tree.
    3. Add a line in the xxx-Info.plist: key NSMicrophoneUsageDescription with a string value explaining to the user how the app uses this data.

    This worked for me, at least with the microphone example project: https://github.com/gideros/Microphone
    The installation instructions on that page (and gideros docs) should be revised (also when it comes to Android, bad path references), although I don't know how to contribute to GitHub myself... :-\"
  • piepie Member
    edited September 2016
    I'm glad you made it work @saeys :)
    I didn't have time to try again with microphone, but I'm planning to do it asap.. in the meanwhile I think that if you manage to update the docs you're more than welcome :)
  • I gave it a try... #:-S
Sign In or Register to comment.