Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by wuselrob · May 20, 2014 at 11:14 AM · c#

Crash on Microphone.Start() in AudioManager::getRecordPosition()

Hi guys,

since weeks I'm trying to find out what makes our game crash when we try to start the microphone on iOS 7.1 (iPad)

Using XCode 5.1 and Unity Pro 4.3.4f1

It seems to crash at this point:

 audio.clip = Microphone.Start(selectedDevice, true, 10, maxFreq);

selectedDevice is null, so the default microphone should be used. "Built-in Microphone" doesn't work either. The xcode debugger shows

 Starting Microphone failed. result=57 (A call to a standard soundcard driver failed, which` could possibly mean a bug in the driver or resources were missing or exhausted. )

/Applications/buildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioManager.cpp line 1481]

StackTrace

 #0    0x017c2f64 in FMOD::SystemI::getRecordPosition(int, unsigned int*) ()
 #1    0x017bae70 in FMOD::System::getRecordPosition(int, unsigned int*) ()
 #2    0x0164fe74 in AudioManager::GetRecordPosition(int) const at /Applications/buildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioManager.cpp:1637
 #3    0x01661bcc in Microphone_CUSTOM_GetPosition(ICallString) at /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/AudioBindings.cpp:1490
 #4    0x0087de08 in m_7b8 ()

My StartMic function looks like

 public void startMicrophone(){
     audio.clip = Microphone.Start(selectedDevice, true, 10, maxFreq);
     audio.loop = true;
     audio.mute = true;
     while (!(Microphone.GetPosition(selectedDevice) > 0)){}
 }

And in my Update() I try this to give the microphone startup a little time:

 void Update(){
   if( audio.isPlaying == false && Microphone.GetPosition( selectedDevice ) > 0 && audio.clip != null ){
     audio.Play();
   }
 }

Sometimes it works perfectly but most of the times the app crashes.

Does anybody know how to fix this?

Best regards, Robert

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wuselrob · May 21, 2014 at 11:16 AM 0
Share

nothing? the interesting thing is, that the app doesn't crash if no other unity scene has been loaded before the scene with the microphone. So when I start the app with the microphone scene first, it works.

hope somebody has an idea :) robert

avatar image nicloay · Aug 19, 2014 at 11:32 AM 0
Share

I'm getting the same error, have you found solution ?

avatar image eyalfx · Aug 28, 2014 at 07:02 PM 0
Share

same issue here. I've noticed it happens more often when I'm debugging from xCode. then if I run without xCode it usually doesn't happen.

avatar image eyalfx · Sep 01, 2014 at 05:17 AM 1
Share

update: well... it doesn't crash, but it completely stops the audio driver (no sound after that). I can also reproduce it consistently now. it's happens every time after using videoTexture via plugin (either prime31 liveTexture or video texture pro 2.0) I tried it on both. crash every time.

avatar image Russel · Jan 06, 2015 at 12:25 PM 0
Share

Have you found a solution?

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by glenn-dai · May 07, 2015 at 06:42 AM

try yield return Application.RequestUserAuthorization(UserAuthorization.Microphone); in your start function, you may need user's permission to run the microphone. It works for me, i don't know whether it will work for you.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by bobmoff · Aug 24, 2015 at 12:43 PM

I have the same problem, but the problem only occurs when using the Microphone and minimizing the app and resuming it again as fast as I possibly can. Then the audiodriver (or something) seem to bail out and all audio in the app is gone after that.

Have not found any solution to this yet.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

A node in a childnode? 1 Answer

Object Reference Not Set As Instance error from ngui code 1 Answer

Need help working with NGUI progress bar 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges