Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
This question was closed Jul 09, 2014 at 05:31 PM by Blayer98 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Blayer98 · Jun 02, 2014 at 09:41 PM · delayqualityendless loop

Audio Quality + Tiny Delay

The audio I'm using in my game sounds great when I preview it in the Unity Player, but going to play-mode decreases the audio quality to something like you'd hear on a 144p YouTube video.

Do I need to make separate files? Do I need to change the format of the file?

Here's the code I use, and yes, the track is an hour long... Which doesn't really make things better, does it?

 using UnityEngine;
 using System.Collections;
 
 public class PlayLengthLoop : MonoBehaviour {
 
     public AudioClip audioClip;
 
     void Start()
     {
        //Add your own times here !
        StartClip(418.500f,425.850f);
     }
 
     void StartClip(float timeStart, float timeEnd)
     {
        audio.clip = audioClip;
        audio.time = timeStart;
        audio.Play();
        StartCoroutine(DelaySoundStop(timeEnd));
     }
 
     IEnumerator DelaySoundStop(float timeEnd)
     {
        while(audio.time < timeEnd)
          yield return null;
        audio.Stop();
 
        //Add your own times here !
        StartClip(418.500f,425.850f);
     }
 }

Also, a delay happens on the track after it finishes looping, in which it loops again, but is there anyway to keep it looping without the need for a delay happening in between?

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 Blayer98 · Jun 02, 2014 at 10:13 PM 0
Share

Okay, I've nailed the Tiny Delay issue!

Here's the new code:

 IEnumerator DelaySoundStop(float timeEnd)
     {
        while(audio.time < timeEnd)
          yield return null;
        StartClip(418.600f,425.850f);
        //Add your own times here !
        
     }
 }

At the moment, I'm still having problems with Audio Quality.

avatar image Blayer98 · Jun 03, 2014 at 07:39 PM 0
Share

Bump. Just doing it because of no response.

avatar image meat5000 ♦ · Jun 03, 2014 at 09:30 PM 1
Share

I notice I have a +2 on this comment.

I set this to "OP Only" :D So that functionality is Broken.

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by screenname_taken · Jun 03, 2014 at 08:20 PM

Check in the audio file's panel to see it's compression. Most probably it's compressing the files to a really low bitrate. You can also loop it there (make sure to select gapless looping if the looping ads a small pop at the end of the file.

Comment
Add comment · Show 3 · 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 Blayer98 · Jun 03, 2014 at 09:26 PM 0
Share

When you mean a "really low bitrate", do you mean a larger or smaller file size?

avatar image screenname_taken · Jun 04, 2014 at 08:26 PM 0
Share

Low bit rate. $$anonymous$$eaning that the file will encode stuff with low quality settings ending in a really small file, but with low quality. The lower the bitrate, the worse the audio quality.

avatar image Blayer98 · Jun 04, 2014 at 09:28 PM 0
Share

ok, thank you!

Follow this Question

Answers Answers and Comments

23 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

Related Questions

Audio playing not in right time when calling from script 1 Answer

How do I put a delay in this? 2 Answers

Touch input reporting 0 delta for first several Updates on iOS, 2 Answers

Show current value of QualitySettings Anti Aliasing in script? 2 Answers

Ingame Quality Settings not recognized 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