Hi there,
I'm a composer and very new to C# scripting.
I am using FMOD Studio as a middleware in this project. I'm fairly sure this is more of an issue with the script I have written though, hence I wanted to ask for assistance on this forum...
I have ambiences playing around the character, and I'm wanting to have FX on these ambiences turn on and off depending on whether the player is moving or not. The script I have written initiates my FMOD event and will also dictate whether my custom parameter within FMOD is turned on (based on if the player pressing the arrow keys).
Here is my script:
------------------------------------------------------------------------------------------------------------------------------------------------------
{
FMOD.Studio.EventInstance MainEvent;
void Start()
{
{
MainEvent = FMODUnity.RuntimeManager.CreateInstance("event:/MainEvent");
}
MainEvent.start();
}
void Update()
{
if (Input.GetAxis("Horizontal") == 1f || Input.GetAxis("Horizontal") == -1f)
{
Debug.Log("Set Param");
MainEvent.setParameterByName("MoveFX", 1f);
}
else
{
{
MainEvent.setParameterByName("MoveFX", 0f);
}
}
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------
The event starts fine and the parameter works in the way I want it to, but a weird thing I'm finding is the spatialisation orientation becomes incorrect.
Instead of the audio being perceptively in front of the player with a wide stereo spread, the audio is panned hard left and is flipped 90 degrees...making the audio sound like it is mono.
I get this warning from Unity:
[FMOD] Instance of Event event:/MainEvent has not had EventInstance.set3DAttributes() called on it yet!
UnityEngine.Debug:LogWarningFormat(String, Object[])
FMODUnity.RuntimeManager:Update() (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:433)
so it has something to do with setting 3D attributes in order for the spatialisation to be correct...
Any help would be greatly appreciated!
Cheers,
- Tom
↧
Audio Spatialization breaks when adding additional scripting
↧
FMOD Parameter return to default value
Hello!
I changed Parameter
hero.EventInstance.setParameterByName (“Surfaces”, 1);
But after sound is finished play, parameter return to default 0.
How keep this value? I using this for change surfaces of steps main character
↧
↧
Unity Error CS1061 - whats the problem?
Hey,
I've been following a yt tutorial for audio implementation in unity and now I'm stuck with the following error:
Assets\Plugins\FMOD\src\Runtime\FmodPlayer.cs(74,21): error CS1061: 'EventInstance' does not contain a definition for 'setParameterValue' and no accessible extension method 'setParameterValue' accepting a first argument of type 'EventInstance' could be found (are you missing a using directive or an assembly reference?)
I even copied the script from the website of the guy who is making these tutorials, with the same result... I'm not a programmer so it's really a pain in the a** for me to find possible mistakes. I would really appreciate any help! Here is the script:
using UnityEngine;
using System.Collections;
public class FmodPlayer : MonoBehaviour
{
private float distance = 0.05f;
private float Material;
private bool wasGrounded = true;
private LayerMask LM = 1 << 31;
private float Height;
private float old_Height;
private float Height_Difference;
FMOD.Studio.EventInstance Footsteps;
void Start()
{
Footsteps = FMODUnity.RuntimeManager.CreateInstance("event:/SFX/Ellen/Ellen_Footsteps");
}
void PlayMeleeEvent(string path)
{
FMODUnity.RuntimeManager.PlayOneShot(path, transform.position);
}
void FixedUpdate()
{
MaterialCheck();
Debug.DrawRay(transform.position, Vector2.down * distance, Color.blue);
PlayerLanded();
wasGrounded = IsGrounded();
IsGrounded();
PlayerFallingCheck();
Footsteps.setParameterValue("Material", Material);
}
void MaterialCheck()
{
RaycastHit2D hit;
hit = Physics2D.Raycast(transform.position, Vector2.down, distance, LM);
if (hit.collider)
{
if (hit.collider.tag == "Material: Earth")
Material = 1f;
else if (hit.collider.tag == "Material: Stone")
Material = 2f;
else
Material = 1f;
}
}
void PlayFootstepsEvent()
{
Footsteps.start();
}
void OnDestroy()
{
Footsteps.release();
}
void PlayerLanded()
{
if (IsGrounded() && !wasGrounded)
{
FMOD.Studio.EventInstance Landing = FMODUnity.RuntimeManager.CreateInstance("event:/SFX/Ellen/Ellen_Land");
Landing.setParameterValue("Velocity", Height_Difference);
Footsteps.setParameterValue("FootstepDuck", Height_Difference);
Landing.start();
Landing.release();
Debug.Log(Height_Difference);
}
}
bool IsGrounded()
{
return Physics2D.Raycast(transform.position, Vector2.down, distance, LM);
}
void PlayerFallingCheck()
{
old_Height = Height;
Height = transform.position.y;
Height_Difference = Height - old_Height;
if (Height_Difference > 0)
Height_Difference = Height_Difference * -1;
}
},Hey,
I've been following a yt tutorial for audio implementation in unity and now I'm stuck with the following error:
Assets\Plugins\FMOD\src\Runtime\FmodPlayer.cs(74,21): error CS1061: 'EventInstance' does not contain a definition for 'setParameterValue' and no accessible extension method 'setParameterValue' accepting a first argument of type 'EventInstance' could be found (are you missing a using directive or an assembly reference?)
I even copied the script from the website of the guy who is making these tutorials, with the same result... I'm not a programmer so it's really a pain in the a** for me to find possible mistakes. I would really appreciate any help! Here is the script:
using UnityEngine;
using System.Collections;
public class FmodPlayer : MonoBehaviour
{
private float distance = 0.05f;
private float Material;
private bool wasGrounded = true;
private LayerMask LM = 1 << 31;
private float Height;
private float old_Height;
private float Height_Difference;
FMOD.Studio.EventInstance Footsteps;
void Start()
{
Footsteps = FMODUnity.RuntimeManager.CreateInstance("event:/SFX/Ellen/Ellen_Footsteps");
}
void PlayMeleeEvent(string path)
{
FMODUnity.RuntimeManager.PlayOneShot(path, transform.position);
}
void FixedUpdate()
{
MaterialCheck();
Debug.DrawRay(transform.position, Vector2.down * distance, Color.blue);
PlayerLanded();
wasGrounded = IsGrounded();
IsGrounded();
PlayerFallingCheck();
Footsteps.setParameterValue("Material", Material);
}
void MaterialCheck()
{
RaycastHit2D hit;
hit = Physics2D.Raycast(transform.position, Vector2.down, distance, LM);
if (hit.collider)
{
if (hit.collider.tag == "Material: Earth")
Material = 1f;
else if (hit.collider.tag == "Material: Stone")
Material = 2f;
else
Material = 1f;
}
}
void PlayFootstepsEvent()
{
Footsteps.start();
}
void OnDestroy()
{
Footsteps.release();
}
void PlayerLanded()
{
if (IsGrounded() && !wasGrounded)
{
FMOD.Studio.EventInstance Landing = FMODUnity.RuntimeManager.CreateInstance("event:/SFX/Ellen/Ellen_Land");
Landing.setParameterValue("Velocity", Height_Difference);
Footsteps.setParameterValue("FootstepDuck", Height_Difference);
Landing.start();
Landing.release();
Debug.Log(Height_Difference);
}
}
bool IsGrounded()
{
return Physics2D.Raycast(transform.position, Vector2.down, distance, LM);
}
void PlayerFallingCheck()
{
old_Height = Height;
Height = transform.position.y;
Height_Difference = Height - old_Height;
if (Height_Difference > 0)
Height_Difference = Height_Difference * -1;
}
}
↧
Unity with FMOD iOS build - many linker errors Xcode
Hi to all,
I need some help to build my first game with Unity FMOD to iOS.
I’ve exported my project in unity and opened it with Xcode, after, i’ve started building but i’ve got an lot of “Match-O Linker” error (201 errors).
I haven’t done any modification to the standard Xcode project exported by unity and I don’t have any plugin in my unity project connected to FMOD.
The FMOD documentation says that i need to disable Unity Audio (https://fmod.com/resources/documentation-api?page=content/generated/engine_new_unity/troubleshooting.html#/) but i can't because i use it in game with an home-made voiceover... how can i do?
here some screenshot of Xcode: https://1drv.ms/f/s!AugIyl84F-ffj_E2SktZpxwDhPKeHw
Anyone can help me?
Thanks
↧
FMOD error: Unsupported file or audio format when setting AuioSource.clip
**Goal**
I am trying to load a local .ogg file into AudioClip to play it back. However, I keep receiving an FMOD error.
**The code I am using**
private IEnumerator getAudio(string path) {
using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path, AudioType.OGGVORBIS))
{
yield return www.SendWebRequest();
if (www.isHttpError || www.isNetworkError)
{
Debug.Log(www.error);
}
else
{
Debug.Log("Is done? " + www.isDone);
goAudioSource.clip = DownloadHandlerAudioClip.GetContent(www);
goAudioSource.Play();
}
}
}
**The error message**
> Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Unsupported file or audio format. ) UnityEngine.Networking.DownloadHandlerAudioClip:GetContent(UnityWebRequest)
I already:
- Made sure that the .ogg file I am
using found via 'path' is a legit
.ogg and can be played back
- Tried to add "file://" before the path
- Made sure that the www has finished downloading before accessing it
Any ideas what might be my problem here?
I am using Unity 2020.1.4f1.
↧
↧
Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Unsupported file or audio format. )
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class TestScript : MonoBehaviour
{
AudioSource audioSource;
AudioClip myClip;
// Start is called before the first frame update
void Start()
{
audioSource = GetComponent();
StartCoroutine(GetAudioClip());
Debug.Log("Starting to download the audio...");
}
// Update is called once per frame
void Update()
{
}
IEnumerator GetAudioClip()
{
using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("https://www.the3rdsequence.com/soundb/data/sounds/55/55.ogg", AudioType.OGGVORBIS))
{
yield return www.SendWebRequest();
if (www.isNetworkError)
{
Debug.Log(www.error);
}
else
{
myClip = DownloadHandlerAudioClip.GetContent(www);
audioSource.clip = myClip;
audioSource.Play();
Debug.Log("Audio is Playing");
}
}
}
public void PauseAudio()
{
audioSource.Pause();
}
public void playAudio()
{
audioSource.Play();
}
public void stopAudio()
{
audioSource.Stop();
}
}//class
Unable to make this work, getting the fmod error
↧
Is there a way to trap an FMOD error?
This is the error message:> Error: Cannot create FMOD::Sound> instance for clip "" (FMOD error:> Unsupported file or audio format. )> UnityEngine.Networking.DownloadHandlerAudioClip:GetContent> (UnityEngine.Networking.UnityWebRequest)
This is the code:
var clip = DownloadHandlerAudioClip.GetContent(uwr);
The clips are user-supplied, outside my control. I just want to trap the error. It doesn't raise an exception.
↧
A hang/crash issue on iOS when a call comes in with 2018.4.27f1,
We found this problem had been solved above unity 2019 except 2018.
This is the official web:https://issuetracker.unity3d.com/issues/application-freezes-if-using-fmod-when-accepting-an-incoming-call-in-ios-15
How can I fix this bug in 2018.4.27f1?
,
↧
Can I use Audio without FMOD in Unity?
hello.
We are developing and providing services with Unity.
Recently, while responding to API 31, we have seen a sharp increase in abnormal terminations in the Google console.
Regarding this, while checking the Firebase Crashlytics log, I checked the log for FMOD.
In Unity's Profiler Guide, I noticed that the audio channel description says:
[Audio Voices - Number of audio (FMOD channels) used in the selected frame.]
We are playing the sound with the Play function of the AudioSource class through the code.
And it was also confirmed that the Audio Voices value changes whenever the Play function is actually executed.
Are the logs checked in Firebase Crashlytics the same as Audio Voices?
Can I use Audio without FMOD in Unity?
I would like to know how to solve it.
I'm asking for help with this.
https://docs.unity.cn/2020.3/Documentation/Manual/ProfilerAudio.html
Thank you in advance.
↧
↧
Fmod Error in builds with massive unity project?
I've been building a really big game with tons of content. Currently the sharedassets0.resource file is ~8 GB in size (almost all videos). Everything works fine in the editor, but in builds my audio clips don't work. When I look at the build logs, I get this error:
Error: Cannot create FMOD::Sound instance for clip "5" (FMOD error: Error loading file. )
When I delete most of my assets (without making any changes to the audio), the error doesn't occur and the audio clips all work fine.
Loading in the audio clips via Resources.Load<> works, but is really annoying. Does anyone know about this issue or what a fix would be? Thanks!
↧
Unity throws FMod Error Loading File in Builds
I'm making a Unity game and in the Editor all audio clips play fine. However, when I try to play them from builds I get this error:
Error: Cannot create FMOD::Sound instance for clip "Variation 1 Master" (FMOD error: Error loading file. )
I've tried loading them in via Resources.Load() instead, and while that works for some of my clips, others continue to throw the same error when I call Resources.Load(). I haven't been able to find anyone else who has seen this issue.
The only thing I can think of is that the size of my project is massive and that is causing problems. My Assets directory is almost 55GB and the build is almost 10GB. Almost all of this is Unity-transcoded videos (which load fine).
Does anyone have any ideas for something I haven't thought of? Thanks!!!
↧
Fmod Unity Global Parameter Vive Controller
Hi.
I'm very new to coding, so this may be very simple. I'm working on a VR musical experience, where the sound is coming from various points around the listener.
I want the user to be able to control the volume via the vive touchpad. I've created a global parameter in FMod, but have no idea how to link the touchpad to the parameter.
I'm using Unity 2020.30f1, and Fmod 2.02.07. I really hope someone can help
Best wishes, Stephen
↧