Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
2
Question by rocket5tim · Mar 24, 2010 at 05:33 PM · audioiphoneaudiosource

wav "clicks" on audio.Stop() and audio.Play() on iPhone

I'm hearing an audible "click" when I call audio.Stop() and audio.Play() on my .wav files. But this click can only be heard on the iPhone, I can't hear it when testing the game via Unity and the Remote. Also there aren't any audible clicks in the .wav files when listening to them outside of Unity.

Here's an example of how I'm calling the Stop and Play:

var SFX_boost : GameObject; // linked to AudioSource var SFX_engine : GameObject;

// normal acceleration, stop boost sound and play engine function Accelerate() { SFX_boost.audio.Stop(); SFX_engine.audio.Play(); }

 // booting, stop engine sound and play boost
 function Boost() {
     SFX_boost.audio.Play();
     SFX_engine.audio.Stop();
 }

 // breaking, stop boost and engine sound
 function Brake() {
     SFX_boost.audio.Stop();
     SFX_engine.audio.Stop();
 }

By using the above method, the .wav's can be stopped abruptly at any point while they're playing, so I suspect this might be part of the problem. But since there's no click sound in the .wav itself, I'm not sure why I'm getting a click on audio.Play().

Comment
Add comment · Show 3
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 Nicolaj Schweitz · Apr 27, 2010 at 05:37 PM 1
Share

You should submit a bugreport on this. Remember to include your project or an example project.

avatar image Jean-Fabre · Sep 02, 2010 at 09:44 AM 0
Share

I get this too, but on regular publish AND within the editor as well.

avatar image Jessy · Sep 16, 2010 at 04:52 AM 0
Share

Do not submit a bug report; it behaves exactly as expected.

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by jtbentley · Sep 07, 2010 at 01:00 PM

Most likely this clip is the result of the audio waveform going from wherever it is to 0.

This is a common problem, what you could do as a workaround (if the Unity guys aren't on it already) is make a simple co-routine to very quickly terminate the sound..

function makeItShutup(fadeSpeed : float) { while(SFX_Boost.audio.volume > 0.01) { SFX_Boost.audio.volume -= fadeSpeed; yield WaitForSeconds(0.001); // Wait roughly 1/10th frame? why not :) }

{

Yeah it's a bit rough, but basically you're just lowering that volume so that no hard-clipping occurs.

Comment
Add comment · Show 2 · 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 Jessy · Sep 16, 2010 at 04:58 AM 0
Share

Here's an explanation of what exactly is going on: http://forum.unity3d.com/viewtopic.php?p=225524#225524

avatar image rocket5tim · Sep 21, 2010 at 02:53 PM 0
Share

Thanks, JT. That's pretty much how I solved it too.

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

No one has followed this question yet.

Related Questions

Audio not coming out of speakers 1 Answer

App crashes due to FMOD error 0 Answers

iPhone pitch not working? 1 Answer

how to load ogg files from documents folder. 1 Answer

Footstep Sounds 1 Answer


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