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
0
Question by xtnz · Jun 24, 2011 at 10:55 AM · wwwogg3d sound

Streaming an ogg file via WWW results in non 3d sound

Is there any way of forcing a sound to become 3d? I am laoding the file via WWW. However the resulting effect is the sound playing at a constant level whichever distance the listener is. Btw I have tryed to default the audio source as a)none and b) with a 3d sound; and then when the sound is triggered I add the following:

 var download = new WWW (path); 
 yield download; 
 var clip : AudioClip = download.oggVorbis; 
 
 if (clip != null) 
 { 
     audio.clip = clip; 
     audio.rolloffMode = AudioRolloffMode.Logarithmic; 
     audio.spread=0.25; audio.minDistance=1; 
     audio.minDistance=10;
     audio.ignoreListenerVolume=true;
     audio.panLevel = 1f;
     audio.Play(); 
 }

Any clue?

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 Marnix · Jun 24, 2011 at 12:26 PM 0
Share

@xtnz: You tagged your question well. Try to format your code next time, so we can actually read it. Press the 010101 button while selecting your complete code. Use a new line for every line of code.

avatar image xtnz · Jun 24, 2011 at 02:48 PM 0
Share

On my face!!:-) Thanks Bunny83.

avatar image xtnz · Jun 26, 2011 at 11:25 AM 0
Share

But this was key:

var clip : AudioClip = download.GetAudioClip(true); //Ins$$anonymous$$d of download.oggVorbis;

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jun 24, 2011 at 02:32 PM

http://unity3d.com/support/documentation/ScriptReference/AudioSource.html

"Mono sounds play back 3D. [...] Stereo sounds are always played back without distance based attenuation."

http://unity3d.com/support/documentation/Components/class-AudioClip.html

"Both mono and multiple channel sounds can be positioned in 3D. For multiple channel audio, use the spread option on the Audio Source to spread and split out the discrete channels in speaker space."

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Help to solve freezes when web client start playing downloaded audioclip 0 Answers

[SOLVED] Cannot create FMOD: Sound instance for resource End of file unexpectedly reached while trying to read essential data,Cannot Create FMOD Sound Instance For Resource 1 Answer

Streaming endless audio 0 Answers

Compressing a WWW.GetAudioClip()'s Data? 0 Answers

Best practice: URL address for storing streamed music files 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